Overview
ingame.lua contains the major systems that run while the game is being played. It manages:
- Custom respawn time calculation
- Team gold balancing
- Buyback status enforcement
- Tower strength scaling
- Troll-combo banning
- The global mutator system
- In-game event listeners (purchases, level-ups, reconnects, order filters)
Ingame singleton class and is lazily required by pregame.lua and commands.lua.
The Ingame class
Ingame:init()
Called once after the heroes have spawned. Wires up all in-game subsystems and registers Custom Game Event listeners.
10v10 player colour map
Player colours for the 10v10 layout are stored inself.playerColors, indexed by playerID. Values are {R, G, B} where each component is in the 0–255 range.
Function reference
Ingame:handleRespawnModifier()
Ingame:handleRespawnModifier()
Registers a listener on the After 40 minutes (
entity_killed game event. When a hero dies it calculates a modified respawn time:timeToIncreaseRespawnRate = 2400 s) the respawn rate increases further unless voteDisableRespawnLimit is true.Ingame:initGoldBalancer()
Ingame:initGoldBalancer()
Sets up a periodic timer that tracks gold disparity between Radiant and Dire. When a significant imbalance is detected, the losing team receives periodic gold injections to keep the game competitive.Key fields written:
self.radiantBalanceMoney/self.direBalanceMoneyself.radiantTotalBalanceMoney/self.direTotalBalanceMoneyself.timeImbalanceStarted
timeToStopBalancingMechanic (1 200 s / 20 minutes).Ingame:checkBuybackStatus()
Ingame:checkBuybackStatus()
Enforces the
buybackCooldownConstant option. Listens for buyback events and applies a flat cooldown on top of the standard Dota buyback timer when the option is non-zero.Ingame:addStrongTowers()
Ingame:addStrongTowers()
Reads
OptionManager:GetOption('strongTowers') and OptionManager:GetOption('towerCount'). Iterates all map towers and scales HP/damage accordingly. Also handles the middleTowers option that adds extra towers to the mid lane.Ingame:loadTrollCombos()
Ingame:loadTrollCombos()
Reads
scripts/kv/troll_combos.kv (or the ban list from the current option set) and populates the internal troll-combo list. When OptionManager:GetOption('banTrollCombos') is true, ability picks that match a troll combo are rejected during selection.Ingame:initGlobalMutator()
Ingame:initGlobalMutator()
Reads all active mutator options (
vampirism, killstreakPower, cooldownReduction, explodeOnDeath, etc.) from OptionManager and applies them as global modifiers to every hero and creep in the game. Each mutator is backed by a modifier_*_mutator Lua class registered in pregame.lua.Ingame:OnPlayerReconnect(keys)
Ingame:OnPlayerReconnect(keys)
Fires 4 seconds after a player reconnects. Sends
lodAttemptReconnect to resync the client’s UI state and re-colours neutral items in the shop.Ingame:OnHeroLeveledUp(keys)
Ingame:OnHeroLeveledUp(keys)
Awards an extra ability point at levels 23 and 24 (which the base game does not grant). Also recalculates the hero’s death XP reward using a custom formula:
Ingame:FilterExecuteOrder(filterTable)
Ingame:FilterExecuteOrder(filterTable)
Order filter registered on the game mode entity. Blocks glyph use when the team’s glyph is already active (custom fortify system). Also blocks neutral item purchases when
OptionManager:GetOption('neutralItems') == 0.Ingame:CommandNotification(tag, message, duration)
Ingame:CommandNotification(tag, message, duration)
Broadcasts a formatted notification message to all clients. Used by cheat commands to announce what was used and by whom.
Vote flags
The following boolean fields on theIngame singleton are set to true when the corresponding player vote passes:
| Field | Command that sets it | Effect |
|---|---|---|
voteEnabledCheatMode | -enablecheat / -ec | Unlocks cheat commands |
voteDoubleCreeps | -doublecreeps / -dc | Sets neutralMultiply to 2 |
voteDisableAntiKamikaze | -enablekamikaze / -ek | Removes kamikaze penalty |
voteDisableRespawnLimit | -enablerespawn / -er | Freezes respawn escalation |
voteEnableFatOMeter | -enablefat / -ef | Activates the Fat-O-Meter |
voteEnableRefresh | -enablerefresh | Refreshes cooldowns on death |
voteEnableBuilder | -enablebuilder / -eb | Opens the ingame hero builder |
voteAntiRat | -antirat / -ar | Locks Tier-3 towers until earlier tiers fall |

