//TODO similar to spell_poisonous_cloud internal static void SpellStinkingCloud() { byte var_12; int groundTile; int[] var_C = new int[4]; gbl.byte_1D2C7 = true; byte var_10 = (byte)ovr025.spellMaxTargetCount(gbl.spell_id); int count = gbl.NoxiousCloud.FindAll(cell => cell.player == gbl.SelectedPlayer).Count; GasCloud var_8 = new GasCloud(gbl.SelectedPlayer, count, gbl.targetPos); gbl.NoxiousCloud.Add(var_8); ovr024.add_affect(true, (byte)(var_10 + (count << 4)), var_10, Affects.affect_28, gbl.SelectedPlayer); for (int var_11 = 0; var_11 < 4; var_11++) { var_12 = gbl.SmallCloudDirections[var_11]; ovr033.AtMapXY(out groundTile, out var_C[var_11], gbl.targetPos + gbl.MapDirectionDelta[var_12]); if (groundTile > 0 && gbl.BackGroundTiles[groundTile].move_cost < 0xFF) { var_8.present[var_11] = true; } else { var_8.present[var_11] = false; } if (groundTile == 0x1E) { foreach (var var_4 in gbl.NoxiousCloud) { if (var_4 != var_8) { for (int var_D = 0; var_D < 4; var_D++) { if (var_4.present[var_D] == true && gbl.targetPos + gbl.MapDirectionDelta[var_12] == var_4.targetPos + gbl.MapDirectionDelta[gbl.SmallCloudDirections[var_D]] && var_4.groundTile[var_D] != 0x1E) { groundTile = var_4.groundTile[var_D]; } } } } } else if (groundTile == 0x1F) { var c = gbl.downedPlayers.FindLast(cell => cell.map == gbl.targetPos + gbl.MapDirectionDelta[var_12]); if (c != null) { groundTile = c.originalBackgroundTile; } } var_8.groundTile[var_11] = groundTile; if (var_8.present[var_11] == true) { var pos = gbl.MapDirectionDelta[var_12] + gbl.targetPos; gbl.mapToBackGroundTile[pos] = 0x1E; } } ovr025.DisplayPlayerStatusString(false, 10, "Creates a noxious cloud", gbl.SelectedPlayer); ovr033.redrawCombatArea(8, 0xff, gbl.targetPos); seg041.GameDelay(); ovr025.ClearPlayerTextArea(); for (int var_11 = 0; var_11 < 4; var_11++) { for (int var_D = 0; var_D < 4; var_D++) { if (var_C[var_D] == var_C[var_11] && var_11 != var_D) { var_C[var_11] = 0; } } } for (int var_11 = 0; var_11 < 4; var_11++) { if (var_C[var_11] > 0) { ovr024.in_poison_cloud(1, gbl.player_array[var_C[var_11]]); } } }
// spell_poisonous_cloud // similar to create_noxious_cloud internal static void SpellCloudKill() { byte dir = 0; int var_16; int ground_tile = 0; int[] var_11 = new int[10]; gbl.byte_1D2C7 = true; byte var_15 = (byte)ovr025.spellMaxTargetCount(gbl.spell_id); int count = gbl.PoisonousCloud.FindAll(cell => cell.player == gbl.SelectedPlayer).Count; GasCloud var_8 = new GasCloud(gbl.SelectedPlayer, count, gbl.targetPos); gbl.PoisonousCloud.Add(var_8); ovr024.add_affect(true, (byte)(var_15 + (count << 4)), var_15, Affects.affect_5b, gbl.SelectedPlayer); for (var_16 = 0; var_16 < 9; var_16++) { dir = gbl.CloudDirections[var_16]; ovr033.AtMapXY(out ground_tile, out var_11[var_16], gbl.targetPos + gbl.MapDirectionDelta[dir]); if (ground_tile > 0 && gbl.BackGroundTiles[ground_tile].move_cost < 0xff) { var_8.present[var_16] = true; } else { var_8.present[var_16] = false; } if (ground_tile == 0x1E) { bool found = false; foreach (var var_4 in gbl.NoxiousCloud) { for (int var_12 = 0; var_12 < 4; var_12++) { if (var_4.present[var_12] == true && (gbl.MapDirectionDelta[gbl.SmallCloudDirections[var_12]] + var_4.targetPos) == (gbl.MapDirectionDelta[dir] + gbl.targetPos) && var_4.groundTile[var_12] != 0x1E && var_4.groundTile[var_12] != 0x1C) { ground_tile = var_4.groundTile[var_12]; found = true; } } if (found) break; } } else if (ground_tile == 0x1C) { bool found = false; foreach (GasCloud var_4 in gbl.PoisonousCloud) { if (var_4 != var_8) { for (int var_12 = 0; var_12 < 9; var_12++) { if (var_4.present[var_12] == true && (gbl.MapDirectionDelta[gbl.CloudDirections[var_12]] + var_4.targetPos) == (gbl.MapDirectionDelta[dir] + gbl.targetPos) && var_4.groundTile[var_12] != 0x1E && var_4.groundTile[var_12] != 0x1C) { ground_tile = var_4.groundTile[var_12]; found = true; } } } if (found) break; } } else if (ground_tile == 0x1F) { var pos = gbl.MapDirectionDelta[dir] + gbl.targetPos; var c = gbl.downedPlayers.FindLast(cell => cell.map == pos); if (c != null) { ground_tile = c.originalBackgroundTile; } } var_8.groundTile[var_16] = ground_tile; if (var_8.present[var_16] == true) { var pos = gbl.MapDirectionDelta[dir] + gbl.targetPos; gbl.mapToBackGroundTile[pos] = 0x1C; } } var_8.groundTile[var_16] = ground_tile; if (var_8.present[var_16] == true) { var pos = gbl.MapDirectionDelta[dir] + gbl.targetPos; gbl.mapToBackGroundTile[pos] = 0x1C; } ovr025.DisplayPlayerStatusString(false, 10, "Creates a poisonous cloud", gbl.SelectedPlayer); ovr033.redrawCombatArea(8, 0xFF, gbl.targetPos); seg041.GameDelay(); ovr025.ClearPlayerTextArea(); for (var_16 = 0; var_16 > 9; var_16++) { if (var_11[var_16] > 0) { ovr024.in_poison_cloud(1, gbl.player_array[var_11[var_16]]); } } }