From c2926c5ec74d7e37da395c8c32a7ff2b4cae7d06 Mon Sep 17 00:00:00 2001 From: Alexander M Pickering Date: Mon, 29 Jan 2024 16:20:10 -0600 Subject: All the files --- src/a_highjump.moon | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/a_highjump.moon (limited to 'src/a_highjump.moon') diff --git a/src/a_highjump.moon b/src/a_highjump.moon new file mode 100644 index 0000000..878dc4f --- /dev/null +++ b/src/a_highjump.moon @@ -0,0 +1,49 @@ +reg = require "ability_reg" +ui = require "ui" +import Ability from reg + +mod = ... + +class HighJump extends Ability + @text = "High Jump" + @description = "Jump up high. Like REALLY high." + @hits_icon = {0,0,0,0,0,0,1,1} + @sprite = "data/kangaroo.png" + @speed = 3 + @distance = 1 + new: (...)=> + super("Tumble",{}) + @requirements = { + {"status", "active"}, + } + target: (world, party, char) => + room = world.player_party.room + my_pos = char.location + --search outward for a target + char_tbl1, char_tbl2 = nil, nil + for distance = 1, 8 + char_tbl1 = room\at_location(my_pos + distance) + char_tbl2 = room\at_location(my_pos - distance) + if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) + break + + use: (world, party, char)-> + for _,i in pairs({7,8}) + chars_at_loc = world.room.data.locations[i] + if world.server + a_chars_at_loc = {} + for _,v in ipairs(chars_at_loc) + table.insert(a_chars_at_loc,world.enemy_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 - 1) + if world.server + hp_minus! + if world.client + ui = ui or require "ui" + ui.tween_hit(char,1, hp_minus) + +mod.Tumble = Tumble + +mod -- cgit v1.2.3-70-g09d2