diff --git a/data/des/des-main.des b/data/des/des-main.des index 3b8b36b..3786458 100644 --- a/data/des/des-main.des +++ b/data/des/des-main.des @@ -389,8 +389,11 @@ this, you share electricity damage with nearby monsters. Wooden boards. Creaky and flammable, but makes you resistant to electricity. % t_water -Someone spilled a lot of water here. It's difficult to sneak through, and will -make you very vulnerable to electricity. You are very resistant to fire though. +Deep water. It would be wise to avoid. + +% t_water_shallow +It's difficult to sneak through, and will make you very vulnerable to +electricity. You are very resistant to fire though. % t_f_lumi Some kind of bluish fungi, glowing serenely in the dim light of the Dungeon. diff --git a/data/des/des-statuses-nonplayer.des b/data/des/des-statuses-nonplayer.des index 6847cf0..a85e01f 100644 --- a/data/des/des-statuses-nonplayer.des +++ b/data/des/des-statuses-nonplayer.des @@ -25,6 +25,9 @@ This is supposed to be a player-only status, and is probably a bug. % nonplayer_Status.RingObscuration This is supposed to be a player-only status, and is probably a bug. +% nonplayer_Status.RingDeceleration +This is supposed to be a player-only status, and is probably a bug. + % nonplayer_Status.DetectHeat This is supposed to be a player-only status, and is probably a bug. @@ -162,6 +165,9 @@ It doesn't seem to be awake... % nonplayer_Status.Slow It is moving 2x more slowly. +% nonplayer_Status.Water +It is in water. + % nonplayer_Status.DayBlindness (Bug) Seems the sun burnt it when it went outside. diff --git a/data/des/des-statuses-player.des b/data/des/des-statuses-player.des index b5e01eb..7e1b51c 100644 --- a/data/des/des-statuses-player.des +++ b/data/des/des-statuses-player.des @@ -25,6 +25,9 @@ Refer to the ring's description. % player_Status.RingObscuration Refer to the ring's description. +% player_Status.RingDeceleration +Refer to the ring's description. + % player_Status.DetectHeat You are detecting sources of heat, as well as enemies attuned to fire. @@ -164,6 +167,9 @@ sounds. % player_Status.Slow You are moving 2x more slowly. +% player_Status.Water +You are in deep water, and are suitably affected. + % player_Status.DayBlindness [BUG] So the sun burnt you when you went outside huh? diff --git a/data/status_help.tsv b/data/status_help.tsv index 0b3c019..b08b134 100644 --- a/data/status_help.tsv +++ b/data/status_help.tsv @@ -52,5 +52,6 @@ .RingingEars "ringing ears" "[bug] singing" "ringing" .Sleeping "sleeping" "dormant" "sleep" .Slow "slowed" - "slow" +.Water "water" - "water" .DayBlindness "day-blinded" - - .NightBlindness "night-blinded" - - diff --git a/src/astar.zig b/src/astar.zig index 39676ec..91d8d6e 100644 --- a/src/astar.zig +++ b/src/astar.zig @@ -76,6 +76,10 @@ pub fn basePenaltyFunc(coord: Coord, opts: state.IsWalkableOptions) usize { else => {}, }; + if (state.dungeon.terrainAt(coord).is_path_penalized) { + c += 50; + } + if (opts.mob) |mob| { if (mob.ai.flag(.FearsDarkness)) { if (!state.dungeon.lightAt(coord).*) @@ -94,7 +98,7 @@ pub fn basePenaltyFunc(coord: Coord, opts: state.IsWalkableOptions) usize { } if (!fire.fireIsSafeFor(mob, state.dungeon.fireAt(coord).*)) - c += 49; + c += 50; } return c; diff --git a/src/combat.zig b/src/combat.zig index 3d13bcc..9deef87 100644 --- a/src/combat.zig +++ b/src/combat.zig @@ -26,6 +26,7 @@ pub const CHANCE_FOR_DIP_EFFECT = 33; const ATTACKER_ENRAGED_BONUS: isize = 20; const ATTACKER_INVIGORATED_BONUS: isize = 10; const ATTACKER_CORRUPT_BONUS: isize = 10; +const ATTACKER_WATER_NBONUS: isize = 10; const ATTACKER_FEAR_NBONUS: isize = 10; const ATTACKER_HELD_NBONUS: isize = 20; const ATTACKER_STUN_NBONUS: isize = 15; @@ -35,6 +36,7 @@ const DEFENDER_UNLIT_BONUS: isize = 5; const DEFENDER_ESHIELD_BONUS: isize = 7; // (per wall, so +7..49) const DEFENDER_INVIGORATED_BONUS: isize = 10; const DEFENDER_OPEN_SPACE_BONUS: isize = 10; +const DEFENDER_WATER_NBONUS: isize = 10; const DEFENDER_ENRAGED_NBONUS: isize = 10; const DEFENDER_RECUPERATE_NBONUS: isize = 10; const DEFENDER_HELD_NBONUS: isize = 10; @@ -96,6 +98,7 @@ pub fn chanceOfMissileLanding(attacker: *const Mob) usize { var chance: isize = attacker.stat(.Missile); chance -= if (attacker.isUnderStatus(.Debil)) |_| ATTACKER_STUN_NBONUS else 0; + chance -= if (attacker.isUnderStatus(.Water)) |_| ATTACKER_WATER_NBONUS else 0; return @intCast(usize, math.clamp(chance, 0, 100)); } @@ -121,6 +124,7 @@ pub fn chanceOfMeleeLanding(attacker: *const Mob, defender: ?*const Mob) usize { chance -= if (attacker.hasStatus(.Fear)) ATTACKER_FEAR_NBONUS else 0; chance -= if (attacker.hasStatus(.Held)) ATTACKER_HELD_NBONUS else 0; chance -= if (attacker.hasStatus(.Debil)) ATTACKER_STUN_NBONUS else 0; + chance -= if (attacker.hasStatus(.Water)) ATTACKER_WATER_NBONUS else 0; chance -= if (attacker.hasStatus(.RingConcentration)) ATTACKER_CONCENTRATE_NBONUS else 0; return @intCast(usize, math.clamp(chance, 0, 100)); @@ -139,6 +143,7 @@ pub fn chanceOfAttackEvaded(defender: *const Mob, attacker: ?*const Mob) usize { chance -= if (defender.hasStatus(.Held)) DEFENDER_HELD_NBONUS else 0; chance -= if (defender.hasStatus(.Debil)) DEFENDER_STUN_NBONUS else 0; + chance -= if (defender.hasStatus(.Water)) DEFENDER_WATER_NBONUS else 0; chance -= if (defender.hasStatus(.Recuperate)) DEFENDER_RECUPERATE_NBONUS else 0; chance -= if (defender.hasStatus(.Enraged)) DEFENDER_ENRAGED_NBONUS else 0; chance -= if (defender.hasStatus(.RingConcentration)) DEFENDER_CONCENTRATE_NBONUS else 0; diff --git a/src/mapgen.zig b/src/mapgen.zig index 9376e9d..d800c1b 100644 --- a/src/mapgen.zig +++ b/src/mapgen.zig @@ -751,7 +751,9 @@ pub fn isRoomInvalid( while (x < room.rect.end().x) : (x += 1) { const coord = Coord.new2(room.rect.start.z, x, y); if (state.dungeon.at(coord).type == .Lava or - state.dungeon.at(coord).type == .Water) + state.dungeon.at(coord).type == .Water or + state.dungeon.terrainAt(coord) == &surfaces.ShallowWaterTerrain or + state.dungeon.terrainAt(coord) == &surfaces.WaterTerrain) { return true; } @@ -813,6 +815,7 @@ pub fn excavatePrefab( const tt: ?TileType = switch (fab.content[y][x]) { .Any, .Connection => null, .Window, .Wall => .Wall, + .Water, .LevelFeature, .Feature, .LockedDoor, @@ -827,7 +830,7 @@ pub fn excavatePrefab( .Corpse, .Ring, => .Floor, - .Water => .Water, + //.Water => .Water, .Lava => .Lava, }; if (tt) |_tt| state.dungeon.at(rc).type = _tt; @@ -918,6 +921,7 @@ pub fn excavatePrefab( .Door => placeDoor(rc, false), .Brazier => _place_machine(rc, Configs[room.rect.start.z].light), .ShallowWater => state.dungeon.at(rc).terrain = &surfaces.ShallowWaterTerrain, + .Water => state.dungeon.at(rc).terrain = &surfaces.WaterTerrain, .Bars => { const p_ind = utils.findById(surfaces.props.items, Configs[room.rect.start.z].bars); _ = placeProp(rc, &surfaces.props.items[p_ind.?]); diff --git a/src/surfaces.zig b/src/surfaces.zig index fe0e6c9..49443ec 100644 --- a/src/surfaces.zig +++ b/src/surfaces.zig @@ -97,6 +97,7 @@ pub const Terrain = struct { effects: []const StatusDataInfo = &[_]StatusDataInfo{}, flammability: usize = 0, fire_retardant: bool = false, + is_path_penalized: bool = false, repairable: bool = true, luminescence: usize = 0, opacity: usize = 0, @@ -196,11 +197,11 @@ pub const WoodTerrain = Terrain{ }; pub const ShallowWaterTerrain = Terrain{ - .id = "t_water", + .id = "t_water_shallow", .name = "shallow water", .color = 0x3c73b1, // medium blue .tile = '≈', - .resists = .{ .rFire = 50, .rElec = -50 }, + .resists = .{ .rFire = 25, .rElec = -25 }, .effects = &[_]StatusDataInfo{ .{ .status = .Conductive, .duration = .{ .Ctx = null } }, }, @@ -211,6 +212,25 @@ pub const ShallowWaterTerrain = Terrain{ .weight = 3, }; +pub const WaterTerrain = Terrain{ + .id = "t_water", + .name = "deep water", + .color = 0x104381, // medium blue + .tile = '≈', + .resists = .{ .rFire = 50, .rElec = -50 }, + .effects = &[_]StatusDataInfo{ + .{ .status = .Conductive, .duration = .{ .Ctx = null } }, + .{ .status = .Noisy, .duration = .{ .Ctx = null } }, + .{ .status = .Water, .duration = .{ .Ctx = null } }, + }, + .fire_retardant = true, + .is_path_penalized = true, + + .for_levels = &[_][]const u8{}, + .placement = .RoomBlob, + .weight = 0, +}; + pub const DeadFungiTerrain = Terrain{ .id = "t_f_dead", .name = "dead fungi", @@ -261,6 +281,8 @@ pub const TERRAIN = [_]*const Terrain{ &MetalTerrain, &CopperTerrain, &WoodTerrain, + &ShallowWaterTerrain, + &WaterTerrain, &DeadFungiTerrain, &TallFungiTerrain, &PillarTerrain, diff --git a/src/types.zig b/src/types.zig index 0fd389a..9dbe408 100644 --- a/src/types.zig +++ b/src/types.zig @@ -1394,6 +1394,11 @@ pub const Status = enum { // Doesn't have a power field. Lifespan, + // Just combat debufs for now. + // + // Doesn't have a power field. + Water, + // }}} pub const TOTAL = @typeInfo(@This()).Enum.fields.len;