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..a9c3407 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): @@ -237,3 +237,12 @@ 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" + 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 018bcc0..bc800ce 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 != 3: + 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,13 @@ 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 == 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.ColdBoltEnemy(*room.center)) else: gm.add_actor(engine.actor.HunterEnemy(*room.center)) engine.rendering.debug_map(gm)