Abstract base class for relic mutators which spawn the actual relics. It should be noted that the implementation of this class precludes creating relic mutators that spawn more than one relic on the map.
- The RelicInventory class representing this relic. This is the only variable you need to use when you're creating a new relic.
- NumPoints, NavPoint
- Internal counters. Used to find a random PathNode as spawning location for the relic.
- Used to prevent double execution of PostBeginPlay. (I have checked that double PostBeginPlay stuff for mutators, could it be corrected in v436? – Wormbo)
- The currently spawned relic.
- function PostBeginPlay()
- This function is responsible for actually spawning the relic by calling the SpawnRelic function. Prior to spawning the relic the places the total count of PathNode objects on the map into the NumPoints property. The number of path nodes is held as a property because it avoids a recount everytime the relic is placed on the map. The function also sets the Timer? to fire every 5 seconds.
- function SpawnRelic(int RecurseCount)
- Spawns a new relic of class RelicClass at a random location of the map. If the location on the map selected by the function already has a relic here then the function calls itself up to a maximum of four times. On the fourth time in a row (like that's ever going to happen) the relic is spawned at the point selected irrespective of any other relics at the same location.
Relics are only ever placed on objects of type PathNode.
- function Mutate(string MutateString, PlayerPawn Sender)
- This function checks the command passed for a case insensitive match on TossRelic. If a match is found and the player is holding a relic, the relic will be dropped.
- function Timer()
- The timer fires every 5 seconds. If thirty seconds passes without the relic being picked up then an object of type RelicSpawnEffect? is created at the same point as the relic and the Relic is then destroyed.
The destruction of the relic causes it to be respawned somewhere else on the map. I do wonder whether it would have been more bandwidth efficient to simply move the relic rather than destroy it and then create a whole new object.
Good question. But maybe it's a network related problem with the SetLocation function. – Wormbo