From 5197d1d31abdf16659e85dd3c4cfc2a1b2d160ef Mon Sep 17 00:00:00 2001 From: JonathanLochridge <43937225+JonathanLochridge@users.noreply.github.com> Date: Fri, 12 Mar 2021 14:28:17 -0600 Subject: [PATCH 1/3] swapped watertype to Ice on Ice level. Made an Acid ranged unit that doesn't properly spawn acid. Signed-off-by: JonathanLochridge <43937225+JonathanLochridge@users.noreply.github.com> --- .idea/7drl-2021.iml | 2 +- .idea/misc.xml | 2 +- engine/actor.py | 8 ++++++++ procgen/dungeon.py | 16 ++++++++++++---- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.idea/7drl-2021.iml b/.idea/7drl-2021.iml index 8e5446a..3421d7f 100644 --- a/.idea/7drl-2021.iml +++ b/.idea/7drl-2021.iml @@ -4,7 +4,7 @@ - + diff --git a/.idea/misc.xml b/.idea/misc.xml index 204bb5c..bfd101b 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + diff --git a/engine/actor.py b/engine/actor.py index ac4cff8..8f3f5fb 100644 --- a/engine/actor.py +++ b/engine/actor.py @@ -237,3 +237,11 @@ class ColdBoltEnemy(Actor): def default_ai(self) -> engine.actions.Action: return engine.actions.RangedIdle(self, effect=engine.effects.Cold(power=1), range=2) + +class AcidBoltEnemy(Actor): + name = "fire caster" + faction = "hostile" + ch = "H" + + def default_ai(self) -> engine.actions.Action: + return engine.actions.RangedIdle(self, effect=engine.effects.PlaceAcid(power=1), range=1) diff --git a/procgen/dungeon.py b/procgen/dungeon.py index 018bcc0..c7f8843 100644 --- a/procgen/dungeon.py +++ b/procgen/dungeon.py @@ -102,6 +102,7 @@ def generate( if level == 2: wallType = engine.tiles.ICE_WALL + waterType = engine.tiles.ICE_FLOOR if level == 3: waterType = engine.tiles.ACID @@ -146,16 +147,20 @@ def generate( tunnel_indices = np.r_[ tcod.los.bresenham(t_start, t_middle), tcod.los.bresenham(t_middle, t_end) # Concatenate lines. ].transpose() # tunnel_indices[axis, index] - tunnel_indices = np.append(tunnel_indices, tunnel_indices - 1, axis=1) # Make tunnels 2 wide. + if level != 2: #makes Ice level have 1 wide walls. + tunnel_indices = np.append(tunnel_indices, tunnel_indices - 1, axis=1) # Make tunnels 2 wide. gm.tiles[tuple(tunnel_indices)] = engine.tiles.FLOOR engine.rendering.debug_map(gm) rooms.append(new_room) # Start of Water generation: # step 1 make random map noise: - randomMap = create_noise_map(width, height, 80) + if level != 2: + randomMap = create_noise_map(width, height, 80) + else: + randomMap = create_noise_map(width, height, 70) - # step 2: feed to cellular automata sevewral times (number of times based on tweaking. + # step 2: feed to cellular automata several times (number of times based on tweaking. automataMap1 = convolve(randomMap, 10) # second value is the number of nearby tiles needed to be water. # step 3: Use map to replace wall and floor tiles with water. @@ -166,7 +171,10 @@ def generate( for room in rooms[1:-1]: if random.randint(0, 1): # gm.add_actor(engine.actor.Actor(*room.center)) #placeholder enemies. - gm.add_actor(engine.actor.ColdBoltEnemy(*room.center)) + if level != 3: + gm.add_actor(engine.actor.ColdBoltEnemy(*room.center)) + else: + gm.add_actor(engine.actor.AcidBoltEnemy(*room.center)) else: gm.add_actor(engine.actor.HunterEnemy(*room.center)) engine.rendering.debug_map(gm) From 77708798554b8adbd6d96501e25b2766848d26cf Mon Sep 17 00:00:00 2001 From: JonathanLochridge <43937225+JonathanLochridge@users.noreply.github.com> Date: Fri, 12 Mar 2021 15:00:20 -0600 Subject: [PATCH 2/3] Made Acid level spawn 1/4 acid spitters, 1/4 heat blasters, and 1/2 melee guys Signed-off-by: JonathanLochridge <43937225+JonathanLochridge@users.noreply.github.com> --- engine/actor.py | 6 +++--- procgen/dungeon.py | 11 +++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/engine/actor.py b/engine/actor.py index 8f3f5fb..130f06c 100644 --- a/engine/actor.py +++ b/engine/actor.py @@ -227,7 +227,7 @@ class HeatBoltEnemy(Actor): ch = "H" def default_ai(self) -> engine.actions.Action: - return engine.actions.RangedIdle(self, effect=engine.effects.Heat(power=2), range=2) + return engine.actions.RangedIdle(self, effect=engine.effects.Heat(power=2), range=3) class ColdBoltEnemy(Actor): @@ -239,9 +239,9 @@ def default_ai(self) -> engine.actions.Action: return engine.actions.RangedIdle(self, effect=engine.effects.Cold(power=1), range=2) class AcidBoltEnemy(Actor): - name = "fire caster" + name = "acid caster" faction = "hostile" - ch = "H" + ch = "A" def default_ai(self) -> engine.actions.Action: return engine.actions.RangedIdle(self, effect=engine.effects.PlaceAcid(power=1), range=1) diff --git a/procgen/dungeon.py b/procgen/dungeon.py index c7f8843..eed49cc 100644 --- a/procgen/dungeon.py +++ b/procgen/dungeon.py @@ -155,7 +155,7 @@ def generate( # Start of Water generation: # step 1 make random map noise: - if level != 2: + if level != 3: randomMap = create_noise_map(width, height, 80) else: randomMap = create_noise_map(width, height, 70) @@ -171,10 +171,13 @@ def generate( for room in rooms[1:-1]: if random.randint(0, 1): # gm.add_actor(engine.actor.Actor(*room.center)) #placeholder enemies. - if level != 3: - gm.add_actor(engine.actor.ColdBoltEnemy(*room.center)) + if level == 1: #Acid level + if random.randint(0, 1): + gm.add_actor(engine.actor.AcidBoltEnemy(*room.center)) + else: + gm.add_actor(engine.actor.HeatBoltEnemy(*room.center)) else: - gm.add_actor(engine.actor.AcidBoltEnemy(*room.center)) + gm.add_actor(engine.actor.ColdBoltEnemy(*room.center)) else: gm.add_actor(engine.actor.HunterEnemy(*room.center)) engine.rendering.debug_map(gm) From 7914b996a835499d08078866c1334073d61d2ca0 Mon Sep 17 00:00:00 2001 From: JonathanLochridge <43937225+JonathanLochridge@users.noreply.github.com> Date: Fri, 12 Mar 2021 16:48:13 -0600 Subject: [PATCH 3/3] Reformated with black Signed-off-by: JonathanLochridge <43937225+JonathanLochridge@users.noreply.github.com> --- engine/actor.py | 1 + procgen/dungeon.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/actor.py b/engine/actor.py index 130f06c..a9c3407 100644 --- a/engine/actor.py +++ b/engine/actor.py @@ -238,6 +238,7 @@ class ColdBoltEnemy(Actor): def default_ai(self) -> engine.actions.Action: return engine.actions.RangedIdle(self, effect=engine.effects.Cold(power=1), range=2) + class AcidBoltEnemy(Actor): name = "acid caster" faction = "hostile" diff --git a/procgen/dungeon.py b/procgen/dungeon.py index eed49cc..bc800ce 100644 --- a/procgen/dungeon.py +++ b/procgen/dungeon.py @@ -147,7 +147,7 @@ def generate( tunnel_indices = np.r_[ tcod.los.bresenham(t_start, t_middle), tcod.los.bresenham(t_middle, t_end) # Concatenate lines. ].transpose() # tunnel_indices[axis, index] - if level != 2: #makes Ice level have 1 wide walls. + if level != 2: # makes Ice level have 1 wide walls. tunnel_indices = np.append(tunnel_indices, tunnel_indices - 1, axis=1) # Make tunnels 2 wide. gm.tiles[tuple(tunnel_indices)] = engine.tiles.FLOOR engine.rendering.debug_map(gm) @@ -171,7 +171,7 @@ def generate( for room in rooms[1:-1]: if random.randint(0, 1): # gm.add_actor(engine.actor.Actor(*room.center)) #placeholder enemies. - if level == 1: #Acid level + if level == 1: # Acid level if random.randint(0, 1): gm.add_actor(engine.actor.AcidBoltEnemy(*room.center)) else: