diff --git a/maps/askellon-sector.w3x/war3map.doo b/maps/askellon-sector.w3x/war3map.doo index e4813923..aa6b517e 100644 Binary files a/maps/askellon-sector.w3x/war3map.doo and b/maps/askellon-sector.w3x/war3map.doo differ diff --git a/maps/askellon-sector.w3x/war3map.imp b/maps/askellon-sector.w3x/war3map.imp index a259da65..63356373 100644 Binary files a/maps/askellon-sector.w3x/war3map.imp and b/maps/askellon-sector.w3x/war3map.imp differ diff --git a/maps/askellon-sector.w3x/war3map.lua b/maps/askellon-sector.w3x/war3map.lua index 4f26efd6..8eb559d3 100644 --- a/maps/askellon-sector.w3x/war3map.lua +++ b/maps/askellon-sector.w3x/war3map.lua @@ -181,6 +181,7 @@ gg_rct_FallZoneBio = nil gg_rct_FallZoneCargoB_Copy = nil gg_rct_FallZoneCargoB_Copy_2 = nil gg_rct_FallZoneBridge_Copy = nil +gg_rct_zoneplanet1 = nil gg_trg_SetKillzones = nil gg_trg_Set = nil gg_trg_SetHatch = nil @@ -339,7 +340,7 @@ function CreateBuildingsForPlayer21() gg_unit_h004_0231 = BlzCreateUnitWithSkin(p, FourCC("h004"), -12992.0, -7424.0, 270.000, FourCC("h004")) u = BlzCreateUnitWithSkin(p, FourCC("n00H"), -6403.0, -12283.9, 180.797, FourCC("n00H")) gg_unit_h004_0367 = BlzCreateUnitWithSkin(p, FourCC("h004"), -7040.0, -10624.0, 270.000, FourCC("h004")) - u = BlzCreateUnitWithSkin(p, FourCC("n00H"), 24190.7, 26579.7, 270.000, FourCC("n00H")) + u = BlzCreateUnitWithSkin(p, FourCC("n00H"), 24766.7, 26131.7, 270.000, FourCC("n00H")) gg_unit_h004_0408 = BlzCreateUnitWithSkin(p, FourCC("h004"), -1536.0, -15808.0, 270.000, FourCC("h004")) u = BlzCreateUnitWithSkin(p, FourCC("n00H"), -961.3, -17580.3, 270.000, FourCC("n00H")) u = BlzCreateUnitWithSkin(p, FourCC("n00H"), -13302.3, -24596.8, 270.000, FourCC("n00H")) @@ -868,6 +869,7 @@ function CreateNeutralPassiveBuildings() gg_unit_n001_0366 = BlzCreateUnitWithSkin(p, FourCC("n001"), -4416.0, -12992.0, 270.000, FourCC("n001")) u = BlzCreateUnitWithSkin(p, FourCC("n00G"), -6337.6, -8457.8, 270.000, FourCC("n00G")) u = BlzCreateUnitWithSkin(p, FourCC("nVOI"), -2688.3, -17742.5, 270.000, FourCC("nVOI")) + u = BlzCreateUnitWithSkin(p, FourCC("n001"), 24384.0, 29120.0, 270.000, FourCC("n001")) gg_unit_n002_0407 = BlzCreateUnitWithSkin(p, FourCC("n002"), -2688.0, -15872.0, 270.000, FourCC("n002")) u = BlzCreateUnitWithSkin(p, FourCC("n003"), -2173.5, -17748.7, 0.486, FourCC("n003")) gg_unit_n002_0413 = BlzCreateUnitWithSkin(p, FourCC("n002"), -3520.0, -18112.0, 270.000, FourCC("n002")) @@ -1077,6 +1079,7 @@ function CreateRegions() gg_rct_FallZoneCargoB_Copy = Rect(-7904.0, -17984.0, -7584.0, -17696.0) gg_rct_FallZoneCargoB_Copy_2 = Rect(-7584.0, -11296.0, -6912.0, -11040.0) gg_rct_FallZoneBridge_Copy = Rect(-11072.0, -13920.0, -10240.0, -13600.0) + gg_rct_zoneplanet1 = Rect(20096.0, 22528.0, 30016.0, 29760.0) end function Trig_SetKillzones_Actions() diff --git a/maps/askellon-sector.w3x/war3map.mmp b/maps/askellon-sector.w3x/war3map.mmp index 208cf11b..38985f76 100644 Binary files a/maps/askellon-sector.w3x/war3map.mmp and b/maps/askellon-sector.w3x/war3map.mmp differ diff --git a/maps/askellon-sector.w3x/war3map.w3a b/maps/askellon-sector.w3x/war3map.w3a index 24594240..a22aea28 100644 Binary files a/maps/askellon-sector.w3x/war3map.w3a and b/maps/askellon-sector.w3x/war3map.w3a differ diff --git a/maps/askellon-sector.w3x/war3map.w3d b/maps/askellon-sector.w3x/war3map.w3d index def6d162..96cc8bde 100644 Binary files a/maps/askellon-sector.w3x/war3map.w3d and b/maps/askellon-sector.w3x/war3map.w3d differ diff --git a/maps/askellon-sector.w3x/war3map.w3e b/maps/askellon-sector.w3x/war3map.w3e index 8b8662c0..21230c94 100644 Binary files a/maps/askellon-sector.w3x/war3map.w3e and b/maps/askellon-sector.w3x/war3map.w3e differ diff --git a/maps/askellon-sector.w3x/war3map.w3i b/maps/askellon-sector.w3x/war3map.w3i index 35b510dc..6f5c7e5e 100644 Binary files a/maps/askellon-sector.w3x/war3map.w3i and b/maps/askellon-sector.w3x/war3map.w3i differ diff --git a/maps/askellon-sector.w3x/war3map.w3q b/maps/askellon-sector.w3x/war3map.w3q index 66b950ca..30d0975f 100644 Binary files a/maps/askellon-sector.w3x/war3map.w3q and b/maps/askellon-sector.w3x/war3map.w3q differ diff --git a/maps/askellon-sector.w3x/war3map.w3r b/maps/askellon-sector.w3x/war3map.w3r index 34060d82..61650d5c 100644 Binary files a/maps/askellon-sector.w3x/war3map.w3r and b/maps/askellon-sector.w3x/war3map.w3r differ diff --git a/maps/askellon-sector.w3x/war3map.w3t b/maps/askellon-sector.w3x/war3map.w3t index 04bf7e28..2079a54a 100644 Binary files a/maps/askellon-sector.w3x/war3map.w3t and b/maps/askellon-sector.w3x/war3map.w3t differ diff --git a/maps/askellon-sector.w3x/war3map.wpm b/maps/askellon-sector.w3x/war3map.wpm index be1199f9..8a2ded36 100644 Binary files a/maps/askellon-sector.w3x/war3map.wpm and b/maps/askellon-sector.w3x/war3map.wpm differ diff --git a/maps/askellon-sector.w3x/war3map.wts b/maps/askellon-sector.w3x/war3map.wts index d4402488..35c544c5 100644 --- a/maps/askellon-sector.w3x/war3map.wts +++ b/maps/askellon-sector.w3x/war3map.wts @@ -6646,3 +6646,33 @@ STRING 1535 Catwalk } +STRING 1536 +// Doodads: D01I (Lava Planet Rock 1), Name (Name) +{ +Lava Planet Rock 1 +} + +STRING 1537 +// Doodads: D01J (Lava Planet Rock 2), Name (Name) +{ +Lava Planet Rock 2 +} + +STRING 1538 +// Doodads: D01K (Lava Planet Rock 3), Name (Name) +{ +Lava Planet Rock 3 +} + +STRING 1539 +// Upgrades: R00J (Troll Regeneration,Improved Troll Regeneration,Advanced Troll Regeneration), Name (Name) +{ +Is Alien Host +} + +STRING 1540 +// Upgrades: R00J (Troll Regeneration,Improved Troll Regeneration,Advanced Troll Regeneration), Tip (Tooltip) +{ +Is Alien Host +} + diff --git a/maps/askellon-sector.w3x/war3mapMap.blp b/maps/askellon-sector.w3x/war3mapMap.blp index 8695f484..01dfbdbd 100644 Binary files a/maps/askellon-sector.w3x/war3mapMap.blp and b/maps/askellon-sector.w3x/war3mapMap.blp differ diff --git a/maps/askellon-sector.w3x/war3mapMisc.txt b/maps/askellon-sector.w3x/war3mapMisc.txt index 24866376..9dd93a68 100644 --- a/maps/askellon-sector.w3x/war3mapMisc.txt +++ b/maps/askellon-sector.w3x/war3mapMisc.txt @@ -53,6 +53,7 @@ NeedHeroXP=500 NeedHeroXPFormulaA=1.0 NeedHeroXPFormulaB=250.0 NeedHeroXPFormulaC=0.0 +PawnItemRate=0.25 StrAttackBonus=0.0 StrHitPointBonus=5.0 diff --git a/maps/askellon-sector.w3x/war3mapUnits.doo b/maps/askellon-sector.w3x/war3mapUnits.doo index 055f8b1e..e587c585 100644 Binary files a/maps/askellon-sector.w3x/war3mapUnits.doo and b/maps/askellon-sector.w3x/war3mapUnits.doo differ diff --git a/src/app/chat/chat-entity.ts b/src/app/chat/chat-entity.ts index 73756af0..051324e5 100644 --- a/src/app/chat/chat-entity.ts +++ b/src/app/chat/chat-entity.ts @@ -295,6 +295,29 @@ export class ChatEntity extends Entity { else if (message.indexOf("-vision") === 0) { const modifier = CreateFogModifierRect(player.handle, FOG_OF_WAR_VISIBLE, bj_mapInitialCameraBounds, true, false); FogModifierStart(modifier); + SetCameraBoundsToRectForPlayerBJ(player.handle, bj_mapInitialPlayableArea); + SetDayNightModels( + "Environment\\DNC\\DNCLordaeron\\DNCLordaeronTerrain\\DNCLordaeronTerrain.mdl", + "Environment\\DNC\\DNCLordaeron\\DNCLordaeronUnit\\DNCLordaeronUnit.mdl" + ); + BlzChangeMinimapTerrainTex("war3mapGenerated.blp"); + } + else if (message.indexOf("-dark") === 0) { + const modifier = CreateFogModifierRect(player.handle, FOG_OF_WAR_VISIBLE, bj_mapInitialCameraBounds, true, false); + FogModifierStart(modifier); + SetCameraBoundsToRectForPlayerBJ(player.handle, bj_mapInitialPlayableArea); + SetDayNightModels( + "", + "" + ); + BlzChangeMinimapTerrainTex("war3mapGenerated.blp"); + } + else if (message.indexOf("-light") === 0) { + const modifier = CreateFogModifierRect(player.handle, FOG_OF_WAR_VISIBLE, bj_mapInitialCameraBounds, true, false); + FogModifierStart(modifier); + SetCameraBoundsToRectForPlayerBJ(player.handle, bj_mapInitialPlayableArea); + SetDayNightModels("DeepFried\\dnclordaeronunit.mdx", "DeepFried\\dnclordaeronunit.mdx"); + BlzChangeMinimapTerrainTex("war3mapGenerated.blp"); } else if (message == "-tp") { // Log.Information("TP"); diff --git a/src/app/force/forces/alien-force.ts b/src/app/force/forces/alien-force.ts index 92482d39..9711cf0a 100644 --- a/src/app/force/forces/alien-force.ts +++ b/src/app/force/forces/alien-force.ts @@ -10,7 +10,7 @@ import { ROLE_TYPES } from "resources/crewmember-names"; import { SoundWithCooldown } from "app/types/sound-ref"; import { STR_CHAT_ALIEN_HOST, STR_CHAT_ALIEN_SPAWN, STR_CHAT_ALIEN_TAG, STR_ALIEN_DEATH } from "resources/strings"; import { BUFF_ID, BUFF_ID_ROACH_ARMOR } from "resources/buff-ids"; -import { DEFAULT_ALIEN_FORM, CREWMEMBER_UNIT_ID, UNIT_ID_NEUTRAL_BEAR, ALIEN_MINION_FORMLESS, UNIT_ID_NEUTRAL_DOG, UNIT_ID_NEUTRAL_RABBIT, UNIT_ID_NEUTRAL_STAG, ALIEN_MINION_CANITE, ALIEN_MINION_LARVA } from "resources/unit-ids"; +import { DEFAULT_ALIEN_FORM, CREWMEMBER_UNIT_ID, UNIT_ID_NEUTRAL_BEAR, ALIEN_MINION_FORMLESS, UNIT_ID_NEUTRAL_DOG, UNIT_ID_NEUTRAL_RABBIT, UNIT_ID_NEUTRAL_STAG, ALIEN_MINION_CANITE, ALIEN_MINION_LARVA, WORM_ALIEN_FORM } from "resources/unit-ids"; import { VISION_TYPE } from "app/vision/vision-type"; import { ResearchFactory } from "app/research/research-factory"; import { EventListener } from "app/events/event-type"; @@ -32,6 +32,8 @@ import { PlayerState } from "../player-type"; import { SFX_ALIEN_BLOOD } from "resources/sfx-paths"; import { CrewmemberForce } from "./crewmember-force"; import { MessagePlayer } from "lib/utils"; +import { Quick } from "lib/Quick"; +import { UPGR_DUMMY_IS_ALIEN_HOST } from "resources/upgrade-ids"; export const MAKE_UNCLICKABLE = false; @@ -247,7 +249,6 @@ export class AlienForce extends ForceType { removePlayer(player: MapPlayer, killer?: Unit) { - Log.Information(`Remove player unit called on ${player.name}`); const forceHasPlayer = this.players.indexOf(player) >= 0; if (forceHasPlayer) { @@ -304,9 +305,39 @@ export class AlienForce extends ForceType { obsForce.addPlayer(player); obsForce.addPlayerMainUnit(crew, player); PlayerStateFactory.get(player).setForce(obsForce); + + if (player === this.alienHost) { + this.repickHost(); + } } } + /** + * Repicks the alien host + */ + repickHost() { + // Let the players know the host died... a second time + Timers.addTimedAction(5, () => { + this.players.forEach(p => { + MessagePlayer(p, `${COL_ALIEN}Children, your ${COL_TEAL}Host|r${COL_ALIEN} may be dead but you are still alive. The hive will promote one of you.`); + }); + }); + // Now try the actual repickening + Timers.addTimedAction(60, () => { + const alienHost = Quick.GetRandomFromArray(this.players, 1)[0]; + + if (alienHost) { + const pData = PlayerStateFactory.get(alienHost); + const crew = PlayerStateFactory.getCrewmember(alienHost); + + this.players.forEach(p => { + MessagePlayer(p, `|cff${pData.originalColour}${crew.name}|r${COL_ALIEN} is your new host.`); + }); + } + + }); + } + removePlayerAlienUnit(whichUnit: Unit) { Log.Information(`Remove alien unit called on ${whichUnit.owner.name}`); // Also need to call remove player as the alien unit dying will also kill the palyer @@ -630,16 +661,33 @@ export class AlienForce extends ForceType { } private applyAlienMinionHost(alien: Unit, isHost: boolean) { + const wasHost = alien.owner === this.alienHost; + if (!isHost) { alien.maxLife = MathRound(alien.maxLife * 0.75); alien.strength = MathRound(alien.strength * 0.75); alien.intelligence = MathRound(alien.intelligence * 0.75); alien.setBaseDamage( MathRound(alien.getBaseDamage(0) * 0.8), 0); alien.setScale(0.8, 0.8, 0.8); - alien.removeAbility(ABIL_ALIEN_EVOLVE_T1_SPELLBOOK); - alien.removeAbility(ABIL_ALIEN_EVOLVE_T2_SPELLBOOK); - alien.removeAbility(ABIL_ALIEN_EVOLVE_T3_SPELLBOOK); alien.name = 'Alien Spawn'; + SetPlayerTechResearched(alien.owner.handle, UPGR_DUMMY_IS_ALIEN_HOST, 0); + } + else { + alien.name = 'Alien Host'; + alien.setScale(1, 1, 1); + + // If we were not Alien Host + // We need to undo the stat penalties + if (!wasHost) { + alien.maxLife = MathRound(alien.maxLife * 1.33); + alien.strength = MathRound(alien.strength * 1.33); + alien.intelligence = MathRound(alien.intelligence * 1.33); + alien.setBaseDamage( MathRound(alien.getBaseDamage(0) * 1.25), 0); + } + + this.setHost(alien.owner); + SetPlayerTechResearched(alien.owner.handle, UPGR_DUMMY_IS_ALIEN_HOST, 1); + } } diff --git a/src/app/force/forces/observer-force.ts b/src/app/force/forces/observer-force.ts index 8c2a8327..4536fc08 100644 --- a/src/app/force/forces/observer-force.ts +++ b/src/app/force/forces/observer-force.ts @@ -71,7 +71,7 @@ export class ObserverForce extends ForceType { this.deltaTicker += delta; // Every few seconds, ping all players to obs - if (this.deltaTicker >= 30) { + if (this.deltaTicker >= 15) { this.deltaTicker = 0; // Loop through all game players diff --git a/src/app/world/world-entity.ts b/src/app/world/world-entity.ts index 6e23acb2..2e6e86a9 100644 --- a/src/app/world/world-entity.ts +++ b/src/app/world/world-entity.ts @@ -13,6 +13,7 @@ import { PlayerStateFactory } from "app/force/player-state-entity"; import { ALIEN_FORCE_NAME } from "app/force/forces/force-names"; import { Hooks } from "lib/Hooks"; import { Entity } from "app/entity-type"; +import { PlanetZone } from "./zones/planet"; export class WorldEntity extends Entity { private static instance: WorldEntity; @@ -42,7 +43,10 @@ export class WorldEntity extends Entity { this.askellon = new TheAskellon(); this.worldZones.set(ZONE_TYPE.SPACE, new SpaceZone(ZONE_TYPE.SPACE)); + this.worldZones.set(ZONE_TYPE.PLANET, new PlanetZone(ZONE_TYPE.PLANET)); + this.allZones.push(this.worldZones.get(ZONE_TYPE.SPACE)); + this.allZones.push(this.worldZones.get(ZONE_TYPE.PLANET)); // Listen to unit travel events EventEntity.listen(new EventListener(EVENT_TYPE.TRAVEL_UNIT_TO, (listener, data) => { diff --git a/src/app/world/zone-id.ts b/src/app/world/zone-id.ts index a8b820f6..7cdad8d9 100644 --- a/src/app/world/zone-id.ts +++ b/src/app/world/zone-id.ts @@ -2,6 +2,8 @@ import { COL_VENTS, COL_CARGO_A, COL_FLOOR_1, COL_GOLD, COL_TEAL, COL_PURPLE, CO export enum ZONE_TYPE { SPACE='SPACE', + PLANET='PLANET', + ARMORY='ARMORY', ARMORY_VENT="ARMORY_VENT", BRIDGE='BRIDGE', @@ -26,6 +28,7 @@ export enum ZONE_TYPE { export const STRING_TO_ZONE_TYPE = new Map(); STRING_TO_ZONE_TYPE.set('SPACE', ZONE_TYPE.SPACE); +STRING_TO_ZONE_TYPE.set('PLANET', ZONE_TYPE.PLANET); STRING_TO_ZONE_TYPE.set('ARMORY', ZONE_TYPE.ARMORY); STRING_TO_ZONE_TYPE.set('ARMORY_VENT', ZONE_TYPE.ARMORY_VENT); STRING_TO_ZONE_TYPE.set('CHURCH', ZONE_TYPE.CHURCH); @@ -44,6 +47,7 @@ STRING_TO_ZONE_TYPE.set('REACTOR', ZONE_TYPE.REACTOR); export const ZONE_TYPE_TO_ZONE_NAME = new Map(); ZONE_TYPE_TO_ZONE_NAME.set(ZONE_TYPE.SPACE, `${COL_PURPLE}Space|r`); +ZONE_TYPE_TO_ZONE_NAME.set(ZONE_TYPE.PLANET, `${COL_PURPLE}Planet|r`); ZONE_TYPE_TO_ZONE_NAME.set(ZONE_TYPE.ARMORY, `${COL_ATTATCH}Armory|r`); ZONE_TYPE_TO_ZONE_NAME.set(ZONE_TYPE.CHURCH, `${COL_GOLD}Cathederal|r`); ZONE_TYPE_TO_ZONE_NAME.set(ZONE_TYPE.SERVICE_TUNNELS_WEST, `${COL_VENTS}Service Tunnels|r`); diff --git a/src/app/world/zones/planet.ts b/src/app/world/zones/planet.ts new file mode 100644 index 00000000..96a8f2de --- /dev/null +++ b/src/app/world/zones/planet.ts @@ -0,0 +1,33 @@ +import { Zone } from "../zone-types/zone-type"; +import { Unit } from "w3ts/index"; +import { PlayerStateFactory } from "app/force/player-state-entity"; +import { SoundRef } from "app/types/sound-ref"; + +export class PlanetZone extends Zone { + + public lavaSound = new SoundRef("Sounds\\LavaLoop.mp3", true, true); + + public onLeave(unit: Unit) { + super.onLeave(unit); + + const crewmember = PlayerStateFactory.getCrewmember(unit.owner); + const isCrew = crewmember && crewmember.unit === unit; + + if (isCrew && crewmember && GetLocalPlayer() === unit.owner.handle) { + this.lavaSound.stopSound(); + SetCameraBoundsToRectForPlayerBJ(unit.owner.handle, bj_mapInitialPlayableArea); + } + } + + public onEnter(unit: Unit) { + super.onEnter(unit); + + const crewmember = PlayerStateFactory.getCrewmember(unit.owner); + const isCrew = crewmember && crewmember.unit === unit; + + if (isCrew && crewmember && GetLocalPlayer() === unit.owner.handle) { + this.lavaSound.playSound(); + SetCameraBoundsToRectForPlayerBJ(unit.owner.handle, bj_mapInitialPlayableArea); + } + } +} \ No newline at end of file diff --git a/src/resources/upgrade-ids.ts b/src/resources/upgrade-ids.ts new file mode 100644 index 00000000..3c468097 --- /dev/null +++ b/src/resources/upgrade-ids.ts @@ -0,0 +1 @@ +export const UPGR_DUMMY_IS_ALIEN_HOST = FourCC('R00J'); \ No newline at end of file