Skip to content

Instantly share code, notes, and snippets.

@pablitar
Last active December 22, 2015 04:25
Show Gist options
  • Save pablitar/1c7415cf64f01c53c1dd to your computer and use it in GitHub Desktop.
Save pablitar/1c7415cf64f01c53c1dd to your computer and use it in GitHub Desktop.
def he = new Character {
name = "David"
hair = dark.as(theNight) + long + messy
shoulders = wide.as(aCar)
}
def excalibur = new Sword(giant, sharp, magical)
he.grab(excalibur)
def hisEnemy = new Character {
name = "Evil Lich"
skeletal
tall
with eyes(of: Flames.blue)
}
def firstAttack = he.charges {
against hisEnemy
with excalibur, new Swing(wide)
screaming loudly
}
hisEnemy.gather(new Magic(of: death, howMuch: aLot))
hisEnemy
.block(firstAttack)
.counterAttack(new Shockwave(performer: hisEnemy, target:he))
class Shockwave {
def performer
def target
def perform() {
target.beKnocked(Force.strong)
performer.clearGatheredMagic()
}
}
he.whenKnocked {
fly(15.meters)
hit(wall)
assert wall.cracked()
}
hisEnemy.walk(how: slowly, towards: he)
hisEnemy.assert {
willNeverWin(he)
shallBe(mine, world)
willRule(how: in(Darkness.eternal))
}
def aChance = he.see {
didnt leave(excalibur, he.hand(Right))
hisEnemy unguarded, drained, too(confident)
}
def surpriseAttack = he.take(aChance).by(new Swing(upward))
surpriseAttack.strike(target: hisEnemy, with: excalibur)
hisEnemy.onStrike {
screech
backUp
freezes astonished
}
he.gathers(Strenght, all)
[1..7].each {
he.strike(target: hisEnemy, with: excalibur)
}
hisEnemy.finally {
falls(to: ground)
becoming(what: ash, how:gradually)
}
he.stand(nextTo(hisEnemy)).andThen {
assert {
willAlways(good.triumphOver(evil))
willPrevail(justice, honor)
}
}
hisEnemy.assert {
fool
hasNoEnd(evil)
shallBeBack
}.with(hisEnemy.breaths.last)
he.emerge {
from theCave
victorious
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment