Skip to content

Commit

Permalink
feat: monster dominate spell
Browse files Browse the repository at this point in the history
  • Loading branch information
goblinhack committed Jul 16, 2023
1 parent 3b5aeb6 commit 6fa34a8
Show file tree
Hide file tree
Showing 36 changed files with 339 additions and 129 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ Content:
- 52 x food
- 20 x treasure
- 14 x weapons
- 14 x spells
- 13 x items
- 12 x buffs
- 9 x skills
- 6 x staffs
- 6 x spells
- 6 x shield
- 6 x boots
- 5 x rings
Expand Down
40 changes: 20 additions & 20 deletions python/gfx.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,16 +421,16 @@ def init_tiles_16x16_main():
"",
"spell_magic_missile",
"spell_magic_missile_activated",
"spell_summon_monst_A",
"spell_summon_monst_A_activated",
"spell_summon_monst_B",
"spell_summon_monst_B_activated",
"spell_summon_monst_C",
"spell_summon_monst_C_activated",
"spell_summon_monst_D",
"spell_summon_monst_D_activated",
"spell_summon_monst_E",
"spell_summon_monst_E_activated",
"spell_summon_monst1",
"spell_summon_monst1_activated",
"spell_summon_monst2",
"spell_summon_monst2_activated",
"spell_summon_monst3",
"spell_summon_monst3_activated",
"spell_summon_monst4",
"spell_summon_monst4_activated",
"spell_summon_monst5",
"spell_summon_monst5_activated",
"spell_summon_food",
"spell_summon_food_activated",
"spell_summon_rock",
Expand All @@ -441,16 +441,16 @@ def init_tiles_16x16_main():
"",
"",
"",
"spell_dominate_monst_A",
"spell_dominate_monst_A_activated",
"spell_dominate_monst_B",
"spell_dominate_monst_B_activated",
"spell_dominate_monst_C",
"spell_dominate_monst_C_activated",
"spell_dominate_monst_D",
"spell_dominate_monst_D_activated",
"spell_dominate_monst_E",
"spell_dominate_monst_E_activated",
"spell_dominate_monst1",
"spell_dominate_monst1_activated",
"spell_dominate_monst2",
"spell_dominate_monst2_activated",
"spell_dominate_monst3",
"spell_dominate_monst3_activated",
"spell_dominate_monst4",
"spell_dominate_monst4_activated",
"spell_dominate_monst5",
"spell_dominate_monst5_activated",
"",
"",
"",
Expand Down
20 changes: 10 additions & 10 deletions python/spell_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
"fd", "spell_summon_food",
"rk", "spell_summon_rock",
"mm", "spell_magic_missile",
"sA", "spell_summon_monst_A",
"sB", "spell_summon_monst_B",
"sC", "spell_summon_monst_C",
"sD", "spell_summon_monst_D",
"sE", "spell_summon_monst_E",
"dA", "spell_dominate_monst_A",
"dB", "spell_dominate_monst_B",
"dC", "spell_dominate_monst_C",
"dD", "spell_dominate_monst_D",
"dE", "spell_dominate_monst_E",
"sA", "spell_summon_monst1",
"sB", "spell_summon_monst2",
"sC", "spell_summon_monst3",
"sD", "spell_summon_monst4",
"sE", "spell_summon_monst5",
"dA", "spell_dominate_monst1",
"dB", "spell_dominate_monst2",
"dC", "spell_dominate_monst3",
"dD", "spell_dominate_monst4",
"dE", "spell_dominate_monst5",
])

my.map_load_spell_tree(
Expand Down
1 change: 1 addition & 0 deletions python/things/monsters/blinkcat.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def tp_init(name, text_long_name):
my.stat_con(self, 10)
my.stat_def(self, 12)
my.stat_dex(self, 18)
my.stat_int(self, 8)
my.stat_luck(self, 18)
my.stat_str(self, 7)
my.teleport_distance(self, 5)
Expand Down
2 changes: 1 addition & 1 deletion python/things/monsters/cthulite.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def tp_init(name, text_long_name):
my.stat_con(self, 20)
my.stat_def(self, 14)
my.stat_dex(self, 8)
my.stat_int(self, 18)
my.stat_int(self, 25)
my.stat_luck(self, 2)
my.stat_psi(self, 18)
my.stat_str(self, 18)
Expand Down
2 changes: 1 addition & 1 deletion python/things/monsters/demon_fire.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def tp_init(name, text_long_name):
my.stat_con(self, 20)
my.stat_def(self, 14)
my.stat_dex(self, 8)
my.stat_int(self, 18)
my.stat_int(self, 22)
my.stat_luck(self, 2)
my.stat_psi(self, 18)
my.stat_str(self, 18)
Expand Down
1 change: 0 additions & 1 deletion python/things/monsters/goat_demon.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ def tp_init(name, text_long_name):
my.is_immune_to_necrosis(self, True)
my.is_immune_to_poison(self, True)
my.is_interesting(self, True)
my.is_lifeless(self, True)
my.is_loggable(self, True)
my.is_meat(self, True)
my.is_monst_class_B(self, True)
Expand Down
1 change: 1 addition & 0 deletions python/things/monsters/kraken.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def tp_init(name, text_long_name):
my.stat_con(self, 18)
my.stat_def(self, 18)
my.stat_dex(self, 8)
my.stat_int(self, 18)
my.stat_luck(self, 10)
my.stat_str(self, 20)
my.temperature_max(self, 50)
Expand Down
1 change: 1 addition & 0 deletions python/things/monsters/reaper.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def tp_init(name, text_long_name):
my.stat_con(self, 25)
my.stat_def(self, 25)
my.stat_dex(self, 10)
my.stat_int(self, 25)
my.stat_luck(self, 10)
my.stat_psi(self, 20)
my.stat_str(self, 25)
Expand Down
2 changes: 1 addition & 1 deletion python/things/monsters/yeti.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def tp_init(name, text_long_name):
my.stat_con(self, 18)
my.stat_def(self, 18)
my.stat_dex(self, 8)
my.stat_int(self, 14)
my.stat_int(self, 18)
my.stat_luck(self, 8)
my.stat_psi(self, 14)
my.stat_str(self, 22)
Expand Down
33 changes: 33 additions & 0 deletions python/things/spells/spell_dominate_monst0.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import my


def on_targeted(me, x, y, bonus):
owner = my.thing_top_owner_id_get(me)
if not owner:
return

existing_mental_load = 0
for f in my.thing_get_followers(me):
existing_mental_load += my.thing_stat_int_bonus(f)

for it in my.level_get_all(me, x, y):
if not my.thing_is_monst(it):
continue

if my.thing_is_dead(it):
my.thing_msg(me, f"The {my.thing_name_get(it)}'s mind is beyond your powers.")
continue

if my.thing_is_ethereal(it):
my.thing_msg(me, f"The {my.thing_name_get(it)}'s mind evades your grasp.")
continue

if not my.thing_set_leader(it, owner):
my.thing_msg(me, f"The {my.thing_name_get(it)} cannot be possessed.")
continue

roll = my.pcg_randint(1, 20) + bonus
if my.thing_stat_psi_total(owner) > roll + my.thing_stat_int_bonus(it) + existing_mental_load:
my.thing_msg(me, f"The {my.thing_name_get(it)}'s mind is beholden to you.")
else:
my.thing_msg(me, f"The {my.thing_name_get(it)} fends off your mental attack.")
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import my
import tp
import spell_dominate_monst0


def on_targeted(me, x, y):
my.place_at(me, "random_monst_class_A", x, y)
return spell_dominate_monst0.on_targeted(me, x, y, 0)


def tp_init(name, text_long_name, text_short_name):
Expand All @@ -16,24 +17,24 @@ def tp_init(name, text_long_name, text_short_name):
my.is_target_select(self, True)
my.is_usable(self, True)
my.on_targeted_do(self, "me.on_targeted()")
my.range_max(self, 7)
my.range_max(self, 5)
my.spell_base_name(self, name)
my.spell_cost(self, 2)
my.text_a_or_an(self, "a")
my.text_description_long(self, "Attempt to dominate a monster with your mind.")
my.text_description_short(self, "Spell, dominate monst A.")
my.text_description_short(self, "Spell, dominate monst I.")
my.text_description_very_short(self, "DomMonstA")
my.z_depth(self, my.MAP_DEPTH_OBJ)
my.z_prio(self, my.MAP_Z_PRIO_BEHIND)
# end sort marker

my.tile(self, tile="spell_dominate_monst_A")
my.tile(self, tile="spell_dominate_monst_A_activated")
my.tile(self, tile="spell_dominate_monst1")
my.tile(self, tile="spell_dominate_monst1_activated")
my.tp_update(self)


def init():
tp_init(name="spell_dominate_monst_A", text_long_name="dominate monst A", text_short_name="dominate monst A")
tp_init(name="spell_dominate_monst1", text_long_name="dominate monst I", text_short_name="dominate monst I")


init()
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import my
import tp
import spell_dominate_monst0


def on_targeted(me, x, y):
my.place_at(me, "random_monst_class_B", x, y)
return spell_dominate_monst0.on_targeted(me, x, y, 1)


def tp_init(name, text_long_name, text_short_name):
Expand All @@ -15,26 +16,27 @@ def tp_init(name, text_long_name, text_short_name):
my.is_spell(self, True)
my.is_target_select(self, True)
my.is_usable(self, True)
my.spell_replaces(self, "spell_dominate_monst_A")
my.spell_replaces(self, "spell_dominate_monst1")
my.on_targeted_do(self, "me.on_targeted()")
my.range_max(self, 7)
my.range_max(self, 6)
my.spell_base_name(self, name)
my.spell_cost(self, 4)
my.text_a_or_an(self, "a")
my.text_description_long(self, "Attempt to dominate a monster with your mind.")
my.text_description_short(self, "Spell, dominate monst B.")
my.text_description_long2(self, "+2 bonus to PSI attack rolls")
my.text_description_short(self, "Spell, dominate monst II.")
my.text_description_very_short(self, "DomMonstB")
my.z_depth(self, my.MAP_DEPTH_OBJ)
my.z_prio(self, my.MAP_Z_PRIO_BEHIND)
# end sort marker

my.tile(self, tile="spell_dominate_monst_B")
my.tile(self, tile="spell_dominate_monst_B_activated")
my.tile(self, tile="spell_dominate_monst2")
my.tile(self, tile="spell_dominate_monst2_activated")
my.tp_update(self)


def init():
tp_init(name="spell_dominate_monst_B", text_long_name="dominate monst B", text_short_name="dominate monst B")
tp_init(name="spell_dominate_monst2", text_long_name="dominate monst II", text_short_name="dominate monst II")


init()
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import my
import tp
import spell_dominate_monst0


def on_targeted(me, x, y):
my.place_at(me, "random_monst_class_C", x, y)
return spell_dominate_monst0.on_targeted(me, x, y, 2)


def tp_init(name, text_long_name, text_short_name):
Expand All @@ -15,26 +16,27 @@ def tp_init(name, text_long_name, text_short_name):
my.is_spell(self, True)
my.is_target_select(self, True)
my.is_usable(self, True)
my.spell_replaces(self, "spell_dominate_monst_B")
my.spell_replaces(self, "spell_dominate_monst2")
my.on_targeted_do(self, "me.on_targeted()")
my.range_max(self, 7)
my.spell_base_name(self, name)
my.spell_cost(self, 6)
my.text_a_or_an(self, "a")
my.text_description_long(self, "Attempt to dominate a monster with your mind.")
my.text_description_short(self, "Spell, dominate monst C.")
my.text_description_long2(self, "+4 bonus to PSI attack rolls")
my.text_description_short(self, "Spell, dominate monst III.")
my.text_description_very_short(self, "DomMonstA")
my.z_depth(self, my.MAP_DEPTH_OBJ)
my.z_prio(self, my.MAP_Z_PRIO_BEHIND)
# end sort marker

my.tile(self, tile="spell_dominate_monst_C")
my.tile(self, tile="spell_dominate_monst_C_activated")
my.tile(self, tile="spell_dominate_monst3")
my.tile(self, tile="spell_dominate_monst3_activated")
my.tp_update(self)


def init():
tp_init(name="spell_dominate_monst_C", text_long_name="dominate monst C", text_short_name="dominate monst C")
tp_init(name="spell_dominate_monst3", text_long_name="dominate monst III", text_short_name="dominate monst III")


init()
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
import my
import tp
import spell_dominate_monst0


def on_targeted(me, x, y):
my.place_at(me, "random_monst_class_D", x, y)
return spell_dominate_monst0.on_targeted(me, x, y, 3)


def tp_init(name, text_long_name, text_short_name):
global self
self = tp.Tp(name, text_long_name, text_short_name)
# begin sort marker
my.gfx_targeted_projectile(self, "projectile_magical_effect")
my.spell_replaces(self, "spell_dominate_monst_C")
my.spell_replaces(self, "spell_dominate_monst3")
my.is_loggable(self, True)
my.is_spell(self, True)
my.is_target_select(self, True)
my.is_usable(self, True)
my.range_max(self, 7)
my.range_max(self, 8)
my.spell_base_name(self, name)
my.spell_cost(self, 8)
my.text_a_or_an(self, "a")
my.text_description_long(self, "Attempt to dominate a monster with your mind.")
my.text_description_short(self, "Spell, dominate monst D.")
my.text_description_long2(self, "+6 bonus to PSI attack rolls")
my.text_description_short(self, "Spell, dominate monst IV.")
my.text_description_very_short(self, "DomMonstD")
my.z_depth(self, my.MAP_DEPTH_OBJ)
my.z_prio(self, my.MAP_Z_PRIO_BEHIND)
# end sort marker

my.tile(self, tile="spell_dominate_monst_D")
my.tile(self, tile="spell_dominate_monst_D_activated")
my.tile(self, tile="spell_dominate_monst4")
my.tile(self, tile="spell_dominate_monst4_activated")
my.tp_update(self)


def init():
tp_init(name="spell_dominate_monst_D", text_long_name="dominate monst D", text_short_name="dominate monst D")
tp_init(name="spell_dominate_monst4", text_long_name="dominate monst IV", text_short_name="dominate monst IV")


init()

0 comments on commit 6fa34a8

Please sign in to comment.