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_strum.moon | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/a_strum.moon (limited to 'src/a_strum.moon') diff --git a/src/a_strum.moon b/src/a_strum.moon new file mode 100644 index 0000000..392a582 --- /dev/null +++ b/src/a_strum.moon @@ -0,0 +1,37 @@ +reg = require "ability_reg" +import Ability from reg + +mod = ... +print("In tubmle, reg is",reg) + +class Strum extends Ability + @text = "Strum" + @description = "Strum a cord to heal the troupe!" + @hits_icon = {1,1,1,1,0,0,0,0} + @sprite = "data/g-clef.png" + @speed = 1 + @distance = 1 + new: (...)=> + super("Strum",{}) + @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)-> + print("Doing Strum, party was", party) + for _, member in pairs(party.members) + member\set_field("hp",member.data.hp + 1) + +mod.Tumble = Tumble + +mod -- cgit v1.2.3-70-g09d2