Last active
September 24, 2016 23:19
-
-
Save gigaherz/a6dd86528691b95568de90669235028b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"__comment": "It may be best to have a difference between localization keys, and actual display strings", | |
"name": "entity.creeper.name", | |
"__comment": "User-defined 'team', useful for distinguishing enemies", | |
"faction": "creeper", | |
"initial_state": "wander", | |
"states": { | |
"wander": { | |
"__comment": "The task defines the actual code handler that will be run", | |
"task": "wander", | |
"__comment": "Events are evaluated periodically, and the first positive match wins", | |
"events": [ | |
{ | |
"source": "entity", | |
"condition": "@faction=player && @distance<10", | |
"set": { | |
"state": "creep", | |
"target": "@entity" | |
} | |
}, | |
{ | |
"source": "entity", | |
"condition": "@faction=cat && @distance<20", | |
"set": { | |
"state": "flee", | |
"target": "@entity", | |
"duration": 100 | |
} | |
} | |
] | |
}, | |
"flee": { | |
"task": "flee", | |
"events": [ | |
{ | |
"source": "self", | |
"condition": "@duration<=0", | |
"set": { | |
"state": "wander", | |
"target": "@entity" | |
} | |
} | |
] | |
}, | |
"creep": { | |
"task": "chase", | |
"events": [ | |
{ | |
"source": "target", | |
"condition": "@distance < 10", | |
"set": { | |
"state": "explode" | |
} | |
}, | |
{ | |
"source": "target", | |
"condition": "@distance > 40", | |
"set": { | |
"state": "wander", | |
"target": "none" | |
} | |
} | |
] | |
}, | |
"explode": { | |
"task": "explode", | |
"events": [ | |
{ | |
"source": "target", | |
"condition": "@distance > 10", | |
"set": { | |
"state": "creep" | |
} | |
} | |
] | |
}, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment