Skip to content

Commit

Permalink
Major Changes:
Browse files Browse the repository at this point in the history
- Added **Repick** Alien host
> If the Alien Host dies, after 60 seconds a new one will rise from the pool of minions
- Reduced cell Price of items from 50% to 25%
> Mined minerals still sell for their old ( unreduced ) prices.
  • Loading branch information
Eonfuzz committed Nov 16, 2020
1 parent ad48001 commit 5a5a3cc
Show file tree
Hide file tree
Showing 23 changed files with 154 additions and 7 deletions.
Binary file modified maps/askellon-sector.w3x/war3map.doo
Binary file not shown.
Binary file modified maps/askellon-sector.w3x/war3map.imp
Binary file not shown.
5 changes: 4 additions & 1 deletion maps/askellon-sector.w3x/war3map.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"))
Expand Down Expand Up @@ -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"))
Expand Down Expand Up @@ -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()
Expand Down
Binary file modified maps/askellon-sector.w3x/war3map.mmp
Binary file not shown.
Binary file modified maps/askellon-sector.w3x/war3map.w3a
Binary file not shown.
Binary file modified maps/askellon-sector.w3x/war3map.w3d
Binary file not shown.
Binary file modified maps/askellon-sector.w3x/war3map.w3e
Binary file not shown.
Binary file modified maps/askellon-sector.w3x/war3map.w3i
Binary file not shown.
Binary file modified maps/askellon-sector.w3x/war3map.w3q
Binary file not shown.
Binary file modified maps/askellon-sector.w3x/war3map.w3r
Binary file not shown.
Binary file modified maps/askellon-sector.w3x/war3map.w3t
Binary file not shown.
Binary file modified maps/askellon-sector.w3x/war3map.wpm
Binary file not shown.
30 changes: 30 additions & 0 deletions maps/askellon-sector.w3x/war3map.wts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Binary file modified maps/askellon-sector.w3x/war3mapMap.blp
Binary file not shown.
1 change: 1 addition & 0 deletions maps/askellon-sector.w3x/war3mapMisc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ NeedHeroXP=500
NeedHeroXPFormulaA=1.0
NeedHeroXPFormulaB=250.0
NeedHeroXPFormulaC=0.0
PawnItemRate=0.25
StrAttackBonus=0.0
StrHitPointBonus=5.0

Binary file modified maps/askellon-sector.w3x/war3mapUnits.doo
Binary file not shown.
23 changes: 23 additions & 0 deletions src/app/chat/chat-entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
58 changes: 53 additions & 5 deletions src/app/force/forces/alien-force.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);

}
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/force/forces/observer-force.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/app/world/world-entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) => {
Expand Down
4 changes: 4 additions & 0 deletions src/app/world/zone-id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -26,6 +28,7 @@ export enum ZONE_TYPE {

export const STRING_TO_ZONE_TYPE = new Map<string, ZONE_TYPE>();
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);
Expand All @@ -44,6 +47,7 @@ STRING_TO_ZONE_TYPE.set('REACTOR', ZONE_TYPE.REACTOR);

export const ZONE_TYPE_TO_ZONE_NAME = new Map<ZONE_TYPE, string>();
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`);
Expand Down
33 changes: 33 additions & 0 deletions src/app/world/zones/planet.ts
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
1 change: 1 addition & 0 deletions src/resources/upgrade-ids.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const UPGR_DUMMY_IS_ALIEN_HOST = FourCC('R00J');

0 comments on commit 5a5a3cc

Please sign in to comment.