
//==============================================================================
//		MESSAGE ALERTS
//==============================================================================

// I forgot that A_Log prints to all players anyway

ACTOR RLMessageSender : RLCustomFunction
{
  States
  {
  Pickup:
	TNT1 A 0 A_Jump(256, "SendMessages")
	Goto SendMessages
  SendMessages:
	TNT1 A 0 A_GiveInventory("RLUniqueItemSpawnMessage", 1, AAPTR_PLAYER1)
    Stop
  Disabled:
	TNT1 A 0
    Stop
  }
}

ACTOR RLLevelFeelingMessage : RLCustomFunction
{
  States
  {
  Pickup:
	TNT1 A 0 A_JumpIf(CallACS("DRLA_messagealerts"), "CheckForAnalyzer")
    Stop
  CheckForAnalyzer: // Check for Signal Analyzer backpack on any player, give accurate message if they do.
/*    TNT1 A 0 A_JumpIfInventory ("RLSignalAnalyzerBackpackToken", 1, "AccurateMessage", AAPTR_PLAYER1)
    TNT1 A 0 A_JumpIfInventory ("RLSignalAnalyzerBackpackToken", 1, "AccurateMessage", AAPTR_PLAYER2)
    TNT1 A 0 A_JumpIfInventory ("RLSignalAnalyzerBackpackToken", 1, "AccurateMessage", AAPTR_PLAYER3)
    TNT1 A 0 A_JumpIfInventory ("RLSignalAnalyzerBackpackToken", 1, "AccurateMessage", AAPTR_PLAYER4)
    TNT1 A 0 A_JumpIfInventory ("RLSignalAnalyzerBackpackToken", 1, "AccurateMessage", AAPTR_PLAYER5)
    TNT1 A 0 A_JumpIfInventory ("RLSignalAnalyzerBackpackToken", 1, "AccurateMessage", AAPTR_PLAYER6)
    TNT1 A 0 A_JumpIfInventory ("RLSignalAnalyzerBackpackToken", 1, "AccurateMessage", AAPTR_PLAYER7)
    TNT1 A 0 A_JumpIfInventory ("RLSignalAnalyzerBackpackToken", 1, "AccurateMessage", AAPTR_PLAYER8)*/
    TNT1 A 0 A_Jump (256, "InaccurateMessage")
	Goto InaccurateMessage
  InaccurateMessage:
    TNT1 A 0 A_Jump(256, 1)
    TNT1 A 0 A_Log("Doesn't seem like anything interesting is around...")
    Stop
  AccurateMessage:
    TNT1 A 0 A_Jump(256, 1)
    TNT1 A 0 A_Log("Nothing of importance detected in current location.")
    Stop
  }
}

// Copied across from Final Doomer.
ACTOR RLSinglePersonMessage : CustomInventory
{
  +INVENTORY.ALWAYSPICKUP
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.NEVERRESPAWN
  +DONTSPLASH
  Radius 4
  Height 4
  Inventory.Amount 0
  Inventory.PickupMessage "fug u"
  Inventory.PickupSound ""
  States
  {
  Spawn:
    TNT1 A 0 NoDelay A_Warp (AAPTR_MASTER, 0,0,0, 0, WARPF_NOCHECKPOSITION)
    TNT1 A 1
    Stop
  }
}

//------------------------------------------------------------------------------
//		LEVEL RESTRICTION MESSAGES

ACTOR RLMeleeOnlyLevelMessage : RLSinglePersonMessage
{
  Inventory.PickupMessage "\cjNone of your guns seem to function here...\c-"
}
ACTOR RLSilencedOnlyLevelMessage : RLSinglePersonMessage
{
  Inventory.PickupMessage "\cjIt's too dangerous to use anything but quiet weaponry here...\c-"
}
ACTOR RLNoBoomLevelMessage : RLSinglePersonMessage
{
  Inventory.PickupMessage "\cjYou can't risk using explosives here...\c-"
}
ACTOR RLBoomOnlyLevelMessage : RLSinglePersonMessage
{
  Inventory.PickupMessage "\cjExplosives seem like the only option here...\c-"
}
ACTOR RLLowTechOnlyLevelMessage : RLSinglePersonMessage
{
  Inventory.PickupMessage "\cjAll of your high tech weapons aren't responding...\c-"
}
ACTOR RLHighTechOnlyLevelMessage : RLSinglePersonMessage
{
  Inventory.PickupMessage "\cjAll your simple weapons have jammed or broken...\c-"
}
ACTOR RLCunningOnlyLevelMessage : RLSinglePersonMessage
{
  Inventory.PickupMessage "\cjFighting is useless...\c-"
}
ACTOR RLNoRechargeLevelMessage : RLSinglePersonMessage
{
  Inventory.PickupMessage "\cjYour rechargeable guns seem to be malfunctioning...\c-"
}

//------------------------------------------------------------------------------
//		ITEM MESSAGES

ACTOR RLUniqueItemSpawnMessageSender : RLMessageSender
{
  States
  {
  SendMessages:
	TNT1 A 0 A_JumpIfInventory("RLUniqueItemSpawnMessageLimiter", 1, "Disabled", AAPTR_PLAYER1)
	TNT1 A 0 A_GiveInventory("RLUniqueItemSpawnMessageLimiter", 1, AAPTR_PLAYER1)
	TNT1 A 0 A_GiveInventory("RLUniqueItemSpawnMessage", 1, AAPTR_PLAYER1)
    Stop
  }
}

ACTOR RLUniqueItemSpawnMessage : RLLevelFeelingMessage
{
  States
  {
  InaccurateMessage:
    TNT1 A 0 A_Jump(256, 1,2,3,4,5)
    TNT1 A 0 A_Log("You feel there is something really valuable here...")
    Stop
    TNT1 A 0 A_Log("You've got a good feeling about this place...")
    Stop
    TNT1 A 0 A_Log("Better search the area, might find something nice...")
    Stop
    TNT1 A 0 A_Log("It seems like this place was used to guard something powerful...")
    Stop
    TNT1 A 0 A_Log("The enemy seems determined to keep you from something...")
    Stop
  AccurateMessage:
    TNT1 A 0 A_Jump(256, 1,2,3,4,5)
    TNT1 A 0 A_Log("A \c[WU]Unique\c- item has been detected in this location.")
    Stop
    TNT1 A 0 A_Log("This location contains a \c[WU]Unique\c- item.")
    Stop
    TNT1 A 0 A_Log("There is a \c[WU]Unique\c- item in this area.")
    Stop
    TNT1 A 0 A_Log("A \c[WU]Unique\c- item has been located here.")
    Stop
    TNT1 A 0 A_Log("At least one \c[WU]Unique\c- item is in this place.")
    Stop
  }
}

ACTOR RLDemonicItemSpawnMessageSender : RLMessageSender
{
  States
  {
  SendMessages:
	TNT1 A 0 A_JumpIfInventory("RLDemonicItemSpawnMessageLimiter", 1, "Disabled", AAPTR_PLAYER1)
	TNT1 A 0 A_GiveInventory("RLDemonicItemSpawnMessageLimiter", 1, AAPTR_PLAYER1)
	TNT1 A 0 A_GiveInventory("RLDemonicItemSpawnMessage", 1, AAPTR_PLAYER1)
    Stop
  }
}

ACTOR RLDemonicItemSpawnMessage : RLLevelFeelingMessage
{
  States
  {
  InaccurateMessage:
    TNT1 A 0 A_Jump(256, 1,2,3,4,5)
    TNT1 A 0 A_Log("You feel a vile, yet unthreatening prescence here...")
    Stop
    TNT1 A 0 A_Log("Strange whispers echo at the edges of your senses...")
    Stop
    TNT1 A 0 A_Log("A lust to kill permeates the area, but without direction...")
    Stop
    TNT1 A 0 A_Log("You feel like something strange is watching you...")
    Stop
    TNT1 A 0 A_Log("The enemy seem obsessed with this place...")
    Stop
  AccurateMessage:
    TNT1 A 0 A_Jump(256, 1,2,3,4,5)
    TNT1 A 0 A_Log("A \c[WD]Demonic\c- item has been detected in this location.")
    Stop
    TNT1 A 0 A_Log("This location contains a \c[WD]Demonic\c- item.")
    Stop
    TNT1 A 0 A_Log("There is a \c[WD]Demonic\c- item in this area.")
    Stop
    TNT1 A 0 A_Log("A \c[WD]Demonic\c- item has been located here.")
    Stop
    TNT1 A 0 A_Log("At least one \c[WD]Demonic\c- item is in this place.")
    Stop
  }
}

ACTOR RLLegendaryItemSpawnMessageSender : RLMessageSender
{
  States
  {
  SendMessages:
	TNT1 A 0 A_JumpIfInventory("RLLegendaryItemSpawnMessageLimiter", 1, "Disabled", AAPTR_PLAYER1)
	TNT1 A 0 A_GiveInventory("RLLegendaryItemSpawnMessageLimiter", 1, AAPTR_PLAYER1)
	TNT1 A 0 A_GiveInventory("RLLegendaryItemSpawnMessage", 1, AAPTR_PLAYER1)
    Stop
  }
}

ACTOR RLLegendaryItemSpawnMessage : RLLevelFeelingMessage
{
  States
  {
  InaccurateMessage:
    TNT1 A 0 A_Jump(256, 1,2,3,4,5)
    TNT1 A 0 A_Log("You feel there is something amazing here...")
    Stop
    TNT1 A 0 A_Log("You have an overwhelming desire to search the area...")
    Stop
    TNT1 A 0 A_Log("You feel safer, as though something was protecting you...")
    Stop
    TNT1 A 0 A_Log("You feel as though you are being guided towards something...")
    Stop
    TNT1 A 0 A_Log("The enemy seems terrified of something, sounds interesting...")
    Stop
  AccurateMessage:
    TNT1 A 0 A_Jump(256, 1,2,3,4,5)
    TNT1 A 0 A_Log("A \c[WL]Legendary\c- item has been detected in this location.")
    Stop
    TNT1 A 0 A_Log("This location contains a \c[WL]Legendary\c- item.")
    Stop
    TNT1 A 0 A_Log("There is a \c[WL]Legendary\c- item in this area.")
    Stop
    TNT1 A 0 A_Log("A \c[WL]Legendary\c- item has been located here.")
    Stop
    TNT1 A 0 A_Log("At least one \c[WL]Legendary\c- item is in this place.")
    Stop
  }
}

ACTOR RLMasterItemSpawnMessageSender : RLMessageSender
{
  States
  {
  SendMessages:
	TNT1 A 0 A_JumpIfInventory("RLMasterItemSpawnMessageLimiter", 1, "Disabled", AAPTR_PLAYER1)
	TNT1 A 0 A_GiveInventory("RLMasterItemSpawnMessageLimiter", 1, AAPTR_PLAYER1)
	TNT1 A 0 A_GiveInventory("RLMasterItemSpawnMessage", 1, AAPTR_PLAYER1)
    Stop
  }
}

ACTOR RLMasterItemSpawnMessage : RLLevelFeelingMessage
{
  States
  {
  InaccurateMessage:
    TNT1 A 0 A_Jump(256, 1,2,3,4,5)
    TNT1 A 0 A_Log("Your PDA is picking up a signal from some highly advanced tech...")
    Stop
    TNT1 A 0 A_Log("Seems like something here is really cool...")
    Stop
    TNT1 A 0 A_Log("This place was marked as containing prototype equipment...")
    Stop
    TNT1 A 0 A_Log("The last log from the engineers indicated something hi-tech was around here...")
    Stop
    TNT1 A 0 A_Log("If there is advanced equipment around here, you want it...")
    Stop
  AccurateMessage:
    TNT1 A 0 A_Jump(256, 1,2,3,4,5)
    TNT1 A 0 A_Log("A \c[MB]Master Assembly\c- has been detected in this location.")
    Stop
    TNT1 A 0 A_Log("This location contains a \c[MB]Master Assembly.\c-")
    Stop
    TNT1 A 0 A_Log("There is a \c[MB]Master Assembly\c- in this area.")
    Stop
    TNT1 A 0 A_Log("A \c[MB]Master Assembly\c- has been located here.")
    Stop
    TNT1 A 0 A_Log("At least one \c[MB]Master Assembly\c- is in this place.")
    Stop
  }
}

//------------------------------------------------------------------------------
//		WARNING MESSAGES

actor RLNewBossMessageDelayer : RLNullActor
{
    States
    {
    Spawn:
	TNT1 A 0
	TNT1 A random(35,700)
	TNT1 A 0 A_GiveInventory("RLNewBossMessage", 1, AAPTR_PLAYER1)
    Stop
    }
}

ACTOR RLNewBossMessage : RLLevelFeelingMessage
{
  States
  {
  InaccurateMessage:
    TNT1 A 0 A_Jump(256, 1,2,3,4,5,6,7,8,9,10)
    TNT1 A 0 A_Log("It seems you've attracted the wrong kind of attention...")
    Stop
    TNT1 A 0 A_Log("Unseen eyes have witnessed your discovery...")
    Stop
    TNT1 A 0 A_Log("You feel the hairs on the back of your neck rise...")
    Stop
    TNT1 A 0 A_Log("You feel the icy grip of fear on your heart...")
    Stop
    TNT1 A 0 A_Log("You feel like you heard something, but not with your ears...")
    Stop
    TNT1 A 0 A_Log("An anxious feeling steals over you, but you can't work out why...")
    Stop
    TNT1 A 0 A_Log("It seems like the shadows around you are growing darker...")
    Stop
    TNT1 A 0 A_Log("Maybe you shouldn't have touched that...")
    Stop
    TNT1 A 0 A_Log("Something unspeakably vile seems to be lurking at the edge of your senses...")
    Stop
    TNT1 A 0 A_Log("Perhaps that item was left there for a reason...")
    Stop
  AccurateMessage:
    TNT1 A 0 A_Jump(256, 1,2,3)
    TNT1 A 0 A_Log("Dangerous enemies have begun tracking your location.")
    Stop
    TNT1 A 0 A_Log("Powerful entities have begun moving towards you.")
    Stop
    TNT1 A 0 A_Log("Picking up that item has caught the attention of dangerous enemies.")
    Stop
  }
}

//------------------------------------------------------------------------------
//		DARK MARTY

ACTOR RLDarkMartyArrivalMessageSender : RLMessageSender
{
  States
  {
  SendMessages:
	TNT1 A 0 A_GiveInventory("RLDarkMartyArrivalMessage", 1, AAPTR_PLAYER1)
    Stop
  }
}

ACTOR RLDarkMartyArrivalMessageSender2 : RLMessageSender
{
  States
  {
  SendMessages:
	TNT1 A 0 A_GiveInventory("RLDarkMartyArrivalMessage2", 1, AAPTR_PLAYER1)
    Stop
  }
}

ACTOR RLDarkMartyArrivalMessage : RLLevelFeelingMessage
{
  States
  {
  InaccurateMessage:
    TNT1 A 0 A_Jump(256, 1,2,3)
    TNT1 A 0 A_Log("It seems someone from the EdgeVerse has arrived to fight you...")
    Stop
    TNT1 A 0 A_Log("Herald of the Treepocalypse, Dark Marty is here...")
    Stop
    TNT1 A 0 A_Log("Looks like you're in trouble, but at least it's not double...")
    Stop
  AccurateMessage:
    TNT1 A 0 A_Log("Dark Marty detected.")
    Stop
  }
}

ACTOR RLDarkMartyArrivalMessage2 : RLLevelFeelingMessage
{
  States
  {
  InaccurateMessage:
    TNT1 A 0 A_Jump(256, 1,2,3)
    TNT1 A 0 A_Log("Dark Marty is here to blast butts and grow trees, but he left his gardening tools at home...")
    Stop
    TNT1 A 0 A_Log("Time for a rematch against Dark Marty...")
    Stop
    TNT1 A 0 A_Log("You'd think he'd have learnt after the first fight...")
    Stop
  AccurateMessage:
    TNT1 A 0 A_Log("Dark Marty detected. Again.")
    Stop
  }
}

//------------------------------------------------------------------------------
//		OTHER

ACTOR RLNuclearBarrelSpawnMessageSender : RLMessageSender
{
  States
  {
  SendMessages:
	TNT1 A 0 A_JumpIfInventory("RLNuclearBarrelSpawnMessageLimiter", 1, "Disabled", AAPTR_PLAYER1)
	TNT1 A 0 A_GiveInventory("RLNuclearBarrelSpawnMessageLimiter", 1, AAPTR_PLAYER1)
	TNT1 A 0 A_GiveInventory("RLNuclearBarrelSpawnMessage", 1, AAPTR_PLAYER1)
    Stop
  }
}

ACTOR RLNuclearBarrelSpawnMessage : RLLevelFeelingMessage
{
  States
  {
  InaccurateMessage:
    TNT1 A 0 A_Jump(256, 1,2,3,4,5)
    TNT1 A 0 A_Log("Your PDA is picking up some background radiation...")
    Stop
    TNT1 A 0 A_Log("Looks like this place contains some really hazardous material...")
    Stop
    TNT1 A 0 A_Log("You feel uneasy in this place, but you aren't sure why...")
    Stop
    TNT1 A 0 A_Log("Your PDA has this place marked as a... Oh no...")
    Stop
    TNT1 A 0 A_Log("Probably best not to cause too much damage in this place...")
    Stop
  AccurateMessage:
    TNT1 A 0 A_Log("At least one Nuclear barrel has been detected.")
    Stop
  }
}
