Skip to content
Permalink
Browse files

Fix water machine interaction icon behaviour.

Add a new actor, InteractionIcon25Health, that only appears if the player's health is less than 25%.
Add a new script that checks whether the player's health is 25 or greater.
Make the WaterMachine and CoffeeMachine spawn InteractionIcon25Health instead of InteractionIcon.

😓 This took me longer than I think it should have to figure out.
  • Loading branch information...
Talon1024 committed Dec 26, 2016
1 parent b79365d commit 9fc9beb6500cc4bbe086f173ae8e9ed100c17a1f
Showing with 23 additions and 3 deletions.
  1. BIN acs/boalib.o
  2. +16 −1 actors/misc/exclamation.txt
  3. +2 −2 actors/props/bureau.txt
  4. +5 −0 source/boalib.acs
BIN +44 Bytes (100%) acs/boalib.o
Binary file not shown.
@@ -70,6 +70,21 @@ ACTOR InteractionIcon
}
}

actor InteractionIcon25Health : InteractionIcon
{
States
{
Spawn:
TNT1 A 0 NoDelay A_CheckRange(128.0, "FadeAway", TRUE)
TNT1 A 0 A_JumpIf(CallACS("PlayerHealthAbove25") == 1, "FadeAway")
ICNI A 1 BRIGHT
Loop
FadeAway:
TNT1 A 10
Goto Spawn
}
}

ACTOR ObjectiveIcon
{
//$Category Misc (Wolf3D)
@@ -86,4 +101,4 @@ ACTOR ObjectiveIcon
TNT1 A -1 NODELAY ACS_NamedExecuteAlways("BoA_CompassQueue",0)
Stop
}
}
}
@@ -363,7 +363,7 @@ ACTOR CoffeeMachine : SwitchableDecoration
"####" A 0 A_JumpIfInventory("CoffeeCounter", 5, "Empty")
Goto SpawnSet
Spawn:
CUP2 A 0 NoDelay A_SpawnItemEx("InteractionIcon", ScaleX*4, 0, 0, 0, 0, 0, 0, SXF_SETMASTER | SXF_CLIENTSIDE)
CUP2 A 0 NoDelay A_SpawnItemEx("InteractionIcon25Health", ScaleX*4, 0, 0, 0, 0, 0, 0, SXF_SETMASTER | SXF_CLIENTSIDE)
SpawnSet:
"####" A -1
Stop
@@ -399,7 +399,7 @@ ACTOR WaterMachine : CoffeeMachine
"####" A 0 A_JumpIfInventory("WaterCounter", 5, "Empty")
Goto SpawnSet
Spawn:
WATR A 0 NoDelay A_SpawnItemEx("InteractionIcon", ScaleX*4, 0, 0, 0, 0, 0, 0, SXF_SETMASTER | SXF_CLIENTSIDE)
WATR A 0 NoDelay A_SpawnItemEx("InteractionIcon25Health", ScaleX*4, 0, 0, 0, 0, 0, 0, SXF_SETMASTER | SXF_CLIENTSIDE)
SpawnSet:
"####" A -1
Stop
@@ -731,3 +731,8 @@ script "VSerum Max Health Boost" (void)
}
GiveInventory("Meal", 5);
}

script "PlayerHealthAbove25" (void)
{
SetResultValue(GetActorProperty(playerID, APROP_Health) >= 25);
}

0 comments on commit 9fc9beb

Please sign in to comment.
You can’t perform that action at this time.