Skip to content
Permalink
Browse files

Fix behaviour of coffee and water machines.

Set activation property so that coffee and water machines set their target pointer to the player who used it.
Check to see whether the target player has less than 100 health before allowing said player to use the machine.
Heal only the target player instead of all players within 32 or 48 map units.

These changes will make coffee and water machines only heal the player who activates it.

📓 I believe this is what the intended behaviour of coffee and water machines is. Correct me if I'm wrong, though...
  • Loading branch information...
Talon1024 committed Nov 15, 2016
1 parent fbeb27d commit 6dc99924ab5e36c54475fcd72ab2f1a9b3232cad
Showing with 10 additions and 6 deletions.
  1. +10 −6 actors/props/bureau.txt
@@ -351,15 +351,17 @@ ACTOR CoffeeMachine : SwitchableDecoration
+SHOOTABLE
+SOLID
+USESPECIAL
Activation THINGSPEC_Switch
Activation THINGSPEC_Switch | THINGSPEC_ThingTargets
States
{
Active:
CUP2 A 0 A_JumpIfInventory("CoffeeCounter", 5, "Empty")
CUP2 A 0 A_JumpIfHealthLower(100, 1, AAPTR_TARGET)
Goto SpawnSet
"####" A 0 A_JumpIfInventory("CoffeeCounter", 5, "Empty")
"####" A 0 A_PlaySound("misc/drink", CHAN_AUTO, 1.0, FALSE, ATTN_NORM)
GiveHealth:
"####" A 1 A_GiveInventory("CoffeeCounter", 1)
"####" A 1 A_RadiusGive("Health", 48, RGF_PLAYERS, 1)
"####" A 1 A_GiveToTarget("Health", 1)
Goto SpawnSet
Spawn:
CUP2 A 0 NoDelay A_SpawnItemEx("InteractionIcon", ScaleX*4, 0, 0, 0, 0, 0, 0, SXF_SETMASTER | SXF_CLIENTSIDE)
@@ -390,11 +392,13 @@ ACTOR WaterMachine : CoffeeMachine
States
{
Active:
WATR A 0 A_JumpIfInventory("WaterCounter", 5, "Empty")
WATR A 0 A_JumpIfHealthLower(100, 1, AAPTR_TARGET)
Goto SpawnSet
"####" A 0 A_JumpIfInventory("WaterCounter", 5, "Empty")
"####" A 0 A_PlaySound("misc/drink", CHAN_AUTO, 1.0, FALSE, ATTN_NORM)
GiveHealth:
"####" A 0 A_GiveInventory("WaterCounter", 1)
"####" A 1 A_RadiusGive("Health", 32, RGF_PLAYERS, 1)
"####" A 1 A_GiveToTarget("Health", 1)
Goto SpawnSet
Spawn:
WATR A 0 NoDelay A_SpawnItemEx("InteractionIcon", ScaleX*4, 0, 0, 0, 0, 0, 0, SXF_SETMASTER | SXF_CLIENTSIDE)
@@ -635,4 +639,4 @@ ACTOR Toys_Waffen : Toys_Hans
"####" AAAA 0 A_SpawnItemEx("Debris_Wood", 0, 0, 0, random(1,3), random(1,3), random(1,3), random(0,360), SXF_CLIENTSIDE)
Stop
}
}
}

0 comments on commit 6dc9992

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