Skip to content

Commit

Permalink
remove Number#toNumberFixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Sicdex committed Oct 28, 2024
1 parent 28fa82c commit bd303f3
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 18 deletions.
9 changes: 0 additions & 9 deletions octarine.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,6 @@ declare interface Number {
*/
/** popcnt */
bitCount(): number
/**
* @requires
* `import "github.com/octarine-public/wrapper/global"` or
* `import { ... } from "github.com/octarine-public/wrapper/index"`
* @param {number} [fractionDigits=3]
*
* @returns {number}
*/
toNumberFixed(fractionDigits?: number): number
/**
* @requires
* `import "github.com/octarine-public/wrapper/global"` or
Expand Down
4 changes: 0 additions & 4 deletions prototypes/number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ Number.prototype.hasMask = function (mask: number): boolean {
return ((this as number) & mask) === mask
}

Number.prototype.toNumberFixed = function (fractionDigits = 3): number {
return parseFloat((this as number).toFixed(fractionDigits))
}

Number.prototype.bitCount = function (): number {
let n = this as number
n = n - ((n >> 1) & 0x55555555)
Expand Down
2 changes: 1 addition & 1 deletion wrapper/Managers/Monitors/UnitChanged.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const Monitor = new (class CPreUnitChanged {
const unit = Units[index]
// see: https://dota2.fandom.com/wiki/Health_Regeneration
unit.HPRegenCounter += unit.HPRegen * 0.1
const regenAmount = Math.round(unit.HPRegenCounter.toNumberFixed(1))
const regenAmount = Math.floor(unit.HPRegenCounter * 10) / 10
unit.HPRegenCounter -= regenAmount
unit.HPPrediction = Math.max(Math.min(unit.MaxHP, unit.HP + regenAmount), 0)
if (!unit.IsVisible) {
Expand Down
3 changes: 1 addition & 2 deletions wrapper/Objects/Base/Projectile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ export class TrackingProjectile extends Projectile {
this.Position.Invalidate()
}
}

public get IsDodgeable(): boolean {
return this.dodgeable
}
Expand All @@ -98,7 +97,7 @@ export class TrackingProjectile extends Projectile {
public get ExpireTime(): number {
return this.expireTime
}

/** @internal */
public Update(
targetEntity: Nullable<Unit | FakeUnit>,
speed: number,
Expand Down
5 changes: 3 additions & 2 deletions wrapper/Objects/Base/Unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,7 @@ export class Unit extends Entity {
}
}
}

public GetAmplificationDamage(
_source: Unit,
_damageType: DAMAGE_TYPES,
Expand Down Expand Up @@ -1090,8 +1091,8 @@ export class Unit extends Entity {

// TODO: damage
public GetDamageBlockers(): Modifier[] {
// for (let index = this.Buffs.length - 1; index > -1; index--) {
// const buff = this.Buffs[index]
// for (let i = this.Buffs.length - 1; i > -1; i--) {
// const buff = this.Buffs[i]
// }
return []
}
Expand Down

0 comments on commit bd303f3

Please sign in to comment.