- // ($ifObject) by tavernHeroes Effects. SoD rules are (determined empirically):
- //* Available hero pool is one for all taverns for a given player
- //* Standalone taverns on the map use the pool of the visiting player
- //* Keep at least 2 heroes available for hire at all times, and ensure no two identical Hero->$id are offered
- // (for one player or for all players as one, it's not clear)
- //* Randomize heroes every 7 days (on Mondays); nevermind if a hero is removed and random immediately selects adding another hero of the same class (Hero->$id)
- //* When own hero surrenders or retreats, replace a random available hero in the pool (most of the time 2nd) with the defeated one
- //* When hiring a hero, generate a new hero; hero removal (due to regeneration or hiring) is permanent
- //* Even if a player has no towns, if he has two heroes, one is defeated and another immediately captures a town - he can recruit the defeated hero
- // However, sometimes the game breaks these rules. For example, it occasionally randomizes one hero at any day, or defers making a retreated hero available for days or even weeks.
- _initializePlayers: function () {
- var size = 2 // XXX=RH to databank
- // Missing in AObject: id, mirrorX, mirrorY, x, y, z, displayOrder,
- // owner and the remainder to the bottom.
- var atter = this.classes.atter([
- // XXX=R:clc:
- 'type', 'texture', 'animation', 'duration', 'width', 'height', 'miniMap', 'passableType', 'passable', 'actionable', 'actionableFromTop'])
- var players = this.map.players.omit('0')