aboutsummaryrefslogtreecommitdiff
path: root/src/a_mope.moon
diff options
context:
space:
mode:
Diffstat (limited to 'src/a_mope.moon')
-rw-r--r--src/a_mope.moon41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/a_mope.moon b/src/a_mope.moon
new file mode 100644
index 0000000..8ea4cd1
--- /dev/null
+++ b/src/a_mope.moon
@@ -0,0 +1,41 @@
+reg = require "ability_reg"
+import Ability from reg
+
+class Mope extends Ability
+ @text = "Mope"
+ @description = "mope"
+ @hits_icon = {0,0,0,1,0,0,0,0}
+ @speed = 5
+ @distance = 1
+ new: (...)=>
+ super(...)
+ @requirements = {
+ {"consume_stat", "stamina", 1},
+ {"status", "active"},
+ {"distance", 1},
+ }
+ target: (world, party, char) =>
+ room = world.player_party.room
+ enemy_party = room.parties[1]
+ if enemy_party == party
+ enemy_party = room.parties[2]
+ use: (world, party, char)->
+ chars_at_loc = world.room.data.locations[4]
+ if world.server
+ a_chars_at_loc = {}
+ for _,v in ipairs(chars_at_loc)
+ table.insert(a_chars_at_loc,world.player_party\member(v.uname))
+ chars_at_loc = a_chars_at_loc
+ hp_minus = () ->
+ for _, char in pairs(chars_at_loc)
+ char\set_field("hp",char.data.hp - 2)
+ if world.server
+ hp_minus!
+ if world.client
+ ui = ui or require "ui"
+ ui.tween_hit(char,1, hp_minus)
+ load: ()=>
+ print("TODO!")
+
+ unload:()=>
+ print("TODO!")