diff --git a/README.md b/README.md index e27a5d6..eb684c1 100644 --- a/README.md +++ b/README.md @@ -63,3 +63,4 @@ All other information should be explored by reading the source code! - [2023/3/21 22:00] feat: support getting hero's candidate id.([#21](https://github.com/Escapingbug/dotaxctf/pull/21)) - [2023/3/23 13:30] fix: remove non-hero units after round ends.([#23](https://github.com/Escapingbug/dotaxctf/pull/23), reporter: AAA剑圣) - [2023/3/24 00:22] feat: support `GetItemInSlot(slot)` to return a sandboxed item.([#24](https://github.com/Escapingbug/dotaxctf/pull/24), reporter: AAA剑圣) +- [2023/3/27 00:22] feat: support getting game time by `GetGameTime()`.([#28](https://github.com/Escapingbug/dotaxctf/pull/28), reporter: Syclover) diff --git a/sandbox.lua b/sandbox.lua index 24b3295..7c388ce 100644 --- a/sandbox.lua +++ b/sandbox.lua @@ -74,10 +74,15 @@ function Sandbox:RunAction(act_func, entity, ctx) return new_ctx end +function GetGameTime() + return GameRules:GetGameTime() +end + function Sandbox:SandboxPublicAPI() local api = { Vector = Vector, QAngle = QAngle, + GetGameTime = GetGameTime, print = print, -- TODO: remove this } return api @@ -261,7 +266,7 @@ function Sandbox:SandboxAbility(ability) GetAOERadius = copy_method(ability, "GetAOERadius"), GetBehavior = copy_method(ability, "GetBehavior"), GetChannelledManaCostPerSecond - = copy_method(ability, "GetChannelledManaCostPerSecond"), + = copy_method(ability, "GetChannelledManaCostPerSecond"), GetChannelTime = copy_method(ability, "GetChannelTime"), GetCooldownTimeRemaining = copy_method(ability, "GetCooldownTimeRemaining"), GetCurrentAbilityCharges = copy_method(ability, "GetCurrentAbilityCharges"), @@ -269,7 +274,7 @@ function Sandbox:SandboxAbility(ability) GetEffectiveCooldown = copy_method(ability, "GetEffectiveCooldown"), GetLevel = copy_method(ability, "GetLevel"), GetLevelSpecialValueNoOverride - = copy_method(ability, "GetLevelSpecialValueNoOverride"), + = copy_method(ability, "GetLevelSpecialValueNoOverride"), GetManaCost = copy_method(ability, "GetManaCost"), GetSpecialValueFor = copy_method(ability, "GetSpecialValueFor"), GetToggleState = copy_method(ability, "GetToggleState"),