Skip to content

Instantly share code, notes, and snippets.

@Blecki
Created April 9, 2014 04:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Blecki/10225817 to your computer and use it in GitHub Desktop.
Save Blecki/10225817 to your computer and use it in GitHub Desktop.
Rule perform spawn when actor.TemplateName == "knight" {
Let actor.Properties.Health = 1;
}
Rule abort die { # Prevent the die activity from being interrupted.
If actor.TemplateName == "knight" {
Return rule-fail;
}
Return rule-pass;
}
Rule perform die when actor.TemplateName == "knight" {
Let actor.State = "defeat";
Wait for 4 turns;
Despawn actor;
}
Rule perform knight slash {
Let actor.State = "slash";
Wait for 2 turns;
Foreach target in [find actors within 1 unit of actor] {
If (target != actor) {
Consider [take 1 damage] with target;
}
}
Wait for 3 turns;
Let actor.State = "idle";
}
Rule do knight-slash {
Perform [knight slash] with actor;
}
Rule perform knight-flinch {
Let actor.State = "victory";
Wait for 2 turns;
Let actor.State = "idle";
}
Rule consider take (n) damage when actor.TemplateName == "knight" { #All other consider rules still run!
Perform [knight-flinch] with actor;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment