Skip to content

Implement SecNum for building DMG #114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
c597e92
Implement SecNum in moster data (timings/resources)
marti-kips Dec 6, 2024
e47d9a8
Inplement SecNum for all health/damage data for monsters and champions
marti-kips Dec 6, 2024
68249eb
Merge branch 'main' of https://github.com/AMXBus/backyard-monsters-re…
marti-kips Dec 10, 2024
fc9c941
SecNum implementation for all building
marti-kips Dec 12, 2024
b0ec6f2
SecNum implementation for all building damage
marti-kips Dec 12, 2024
4fcc580
Merge branch 'SecNumBuildingDMG' of https://github.com/AMXBus/backyar…
marti-kips Dec 12, 2024
0d60eaa
Merge branch 'bym-refitted:main' into SecNumBuildingDMG
AMXBus Dec 12, 2024
1d38017
Merge branch 'bym-refitted:main' into SecNumBuildingDMG
AMXBus Dec 13, 2024
138e50d
Merge branch 'bym-refitted:main' into SecNumBuildingDMG
AMXBus Dec 16, 2024
e6c9f09
Merge branch 'bym-refitted:main' into SecNumBuildingDMG
AMXBus Dec 18, 2024
64e094e
Merge branch 'bym-refitted:main' into SecNumBuildingDMG
AMXBus Dec 24, 2024
fbd7a58
Merge branch 'bym-refitted:main' into SecNumBuildingDMG
AMXBus Jan 2, 2025
861a49a
Merge branch 'main' into SecNumBuildingDMG
AMXBus Apr 22, 2025
f1509c8
Merge branch 'bym-refitted:main' into SecNumBuildingDMG
AMXBus Apr 24, 2025
0c13e68
Merge branch 'bym-refitted:main' into SecNumBuildingDMG
AMXBus May 6, 2025
d96dbe3
Merge branch 'bym-refitted:main' into SecNumBuildingDMG
AMXBus May 27, 2025
7d41327
Merge branch 'bym-refitted:main' into SecNumBuildingDMG
AMXBus Jun 5, 2025
ca6cd5b
Merge branch 'bym-refitted:main' into SecNumBuildingDMG
AMXBus Jul 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions client/scripts/ACADEMY.as
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ package
if(GLOBAL.player.m_upgrades[param1].level <= _building._lvl.Get())
{
_loc6_ = CREATURELOCKER._creatures[param1].trainingCosts[GLOBAL.player.m_upgrades[param1].level - 1];
if(BASE.Charge(3,_loc6_[0],true) > 0)
if(BASE.Charge(3,_loc6_[0].Get(),true) > 0)
{
if(!param2)
{
BASE.Charge(3,_loc6_[0]);
GLOBAL.player.m_upgrades[param1].time = new SecNum(GLOBAL.Timestamp() + _loc6_[1]);
GLOBAL.player.m_upgrades[param1].duration = _loc6_[1];
BASE.Charge(3,_loc6_[0].Get());
GLOBAL.player.m_upgrades[param1].time = new SecNum(GLOBAL.Timestamp() + _loc6_[1].Get());
GLOBAL.player.m_upgrades[param1].duration = _loc6_[1].Get();
_building._upgrading = param1;
BASE.Save();
LOGGER.Stat([11,int(param1.substr(1)),GLOBAL.player.m_upgrades[param1].level + 1]);
Expand Down Expand Up @@ -169,7 +169,7 @@ package
break;
}
}
BASE.Fund(3,CREATURELOCKER._creatures[param1].trainingCosts[GLOBAL.player.m_upgrades[param1].level - 1][0]);
BASE.Fund(3,CREATURELOCKER._creatures[param1].trainingCosts[GLOBAL.player.m_upgrades[param1].level - 1][0].Get());
BASE.Save();
}

Expand Down
34 changes: 17 additions & 17 deletions client/scripts/ACADEMYPOPUP.as
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ package
{
_maxSpeed = CREATURES.GetProperty(_loc2_,"speed",10);
}
if(CREATURES.GetProperty(_loc2_,"health",10) > _maxHealth)
if(CREATURES.GetProperty(_loc2_,"health",10).Get() > _maxHealth)
{
_maxHealth = CREATURES.GetProperty(_loc2_,"health",10);
}
if(CREATURES.GetProperty(_loc2_,"damage",10) > _maxDamage)
if(CREATURES.GetProperty(_loc2_,"damage",10).Get() > _maxDamage)
{
_maxDamage = CREATURES.GetProperty(_loc2_,"damage",10);
_maxDamage = CREATURES.GetProperty(_loc2_,"damage",10).Get();
}
if(CREATURES.GetProperty(_loc2_,"cTime",10) > _maxTime)
{
Expand Down Expand Up @@ -153,8 +153,8 @@ package
{
var _loc1_:Array = CREATURELOCKER._creatures[_monsterID].trainingCosts[GLOBAL.player.m_upgrades[_monsterID].level - 1];
var _loc2_:String = KEYS.Get(CREATURELOCKER._creatures[_monsterID].name);
var _loc3_:int = int(_loc1_[0]);
var _loc4_:int = int(_loc1_[1]);
var _loc3_:int = int(_loc1_[0].Get());
var _loc4_:int = int(_loc1_[1].Get());
var _loc5_:int = STORE.GetTimeCost(_loc4_);
var _loc6_:int = Math.ceil(Math.pow(Math.sqrt(_loc3_ / 2),0.75));
_instantUpgradeCost = _loc5_ + _loc6_;
Expand Down Expand Up @@ -223,10 +223,10 @@ package
bB.mcR1.visible = true;
bB.mcR2.visible = true;
bB.mcR3.visible = true;
bB.mcR3.tValue.htmlText = "<b><font color=\"#" + (_loc4_[0] > GLOBAL._resources.r3.Get() ? "FF0000" : "000000") + "\">" + GLOBAL.FormatNumber(_loc4_[0]) + "</font></b>";
bB.mcR3.tValue.htmlText = "<b><font color=\"#" + (_loc4_[0].Get() > GLOBAL._resources.r3.Get() ? "FF0000" : "000000") + "\">" + GLOBAL.FormatNumber(_loc4_[0].Get()) + "</font></b>";
bB.mcR4.visible = true;
bB.mcTime.visible = true;
bB.mcTime.tValue.htmlText = "<b>" + GLOBAL.ToTime(_loc4_[1]) + "</b>";
bB.mcTime.tValue.htmlText = "<b>" + GLOBAL.ToTime(_loc4_[1].Get()) + "</b>";
}
else if(_loc3_.status == KEYS.Get("acad_err_putty") || _loc3_.status == KEYS.Get("acad_err_sulfur"))
{
Expand All @@ -237,10 +237,10 @@ package
bB.mcR1.visible = true;
bB.mcR2.visible = true;
bB.mcR3.visible = true;
bB.mcR3.tValue.htmlText = "<b><font color=\"#" + (_loc4_[0] > GLOBAL._resources.r3.Get() ? "FF0000" : "000000") + "\">" + GLOBAL.FormatNumber(_loc4_[0]) + "</font></b>";
bB.mcR3.tValue.htmlText = "<b><font color=\"#" + (_loc4_[0].Get() > GLOBAL._resources.r3.Get() ? "FF0000" : "000000") + "\">" + GLOBAL.FormatNumber(_loc4_[0].Get()) + "</font></b>";
bB.mcR4.visible = true;
bB.mcTime.visible = true;
bB.mcTime.tValue.htmlText = "<b>" + GLOBAL.ToTime(_loc4_[1]) + "</b>";
bB.mcTime.tValue.htmlText = "<b>" + GLOBAL.ToTime(_loc4_[1].Get()) + "</b>";
this.CalculateInstantCost();
bA.bAction.Setup(KEYS.Get("btn_useshiny",{"v1":_instantUpgradeCost}));
bA.bAction.removeEventListener(MouseEvent.CLICK,this.InstantMonsterUpgrade);
Expand Down Expand Up @@ -279,7 +279,7 @@ package
var _loc5_:* = (_loc5_ = (_loc5_ = "<b>" + KEYS.Get("acad_mon_name") + "</b> " + KEYS.Get(CREATURELOCKER._creatures[_monsterID].name) + "<br>") + ("<b>" + KEYS.Get("acad_mon_status") + "</b> " + _loc3_.status)) + ("<br>" + KEYS.Get(CREATURELOCKER._creatures[_monsterID].description));
tName.htmlText = _loc5_;
var _loc6_:int;
if((_loc6_ = CREATURES.GetProperty(_monsterID,"damage")) > 0)
if((_loc6_ = CREATURES.GetProperty(_monsterID,"damage").Get()) > 0)
{
_loc7_ = false;
}
Expand All @@ -288,7 +288,7 @@ package
_loc7_ = true;
}
bSpeedA.mcBar.width = 100 / _maxSpeed * CREATURES.GetProperty(_monsterID,"speed");
bHealthA.mcBar.width = 100 / _maxHealth * CREATURES.GetProperty(_monsterID,"health");
bHealthA.mcBar.width = 100 / _maxHealth * CREATURES.GetProperty(_monsterID,"health").Get();
if(!_loc7_)
{
bDamageA.mcBar.width = 100 / _maxDamage * _loc6_;
Expand All @@ -301,7 +301,7 @@ package
bStorageA.mcBar.width = 100 / _maxStorage * CREATURES.GetProperty(_monsterID,"cStorage");
bTimeA.mcBar.width = 100 / _maxTime * CREATURES.GetProperty(_monsterID,"cTime");
tSpeedA.htmlText = KEYS.Get("mon_att_speedvalue",{"v1":CREATURES.GetProperty(_monsterID,"speed")});
tHealthA.htmlText = CREATURES.GetProperty(_monsterID,"health").toString();
tHealthA.htmlText = CREATURES.GetProperty(_monsterID,"health").Get().toString();
if(!_loc7_)
{
tDamageA.htmlText = _loc6_.toString();
Expand Down Expand Up @@ -337,19 +337,19 @@ package
{
_loc8_ = int(GLOBAL.player.m_upgrades[_monsterID].level);
}
_loc6_ = CREATURES.GetProperty(_monsterID,"damage",_loc8_);
_loc6_ = CREATURES.GetProperty(_monsterID,"damage",_loc8_).Get();
if(_loc7_)
{
_loc6_ = -_loc6_;
}
bSpeedB.mcBar.width = 100 / _maxSpeed * CREATURES.GetProperty(_monsterID,"speed",_loc8_);
bHealthB.mcBar.width = 100 / _maxHealth * CREATURES.GetProperty(_monsterID,"health",_loc8_);
bHealthB.mcBar.width = 100 / _maxHealth * CREATURES.GetProperty(_monsterID,"health",_loc8_).Get();
bDamageB.mcBar.width = 100 / _maxDamage * _loc6_;
bResourceB.mcBar.width = 100 / _maxResource * CREATURES.GetProperty(_monsterID,"cResource",_loc8_);
bStorageB.mcBar.width = 100 / _maxStorage * CREATURES.GetProperty(_monsterID,"cStorage",_loc8_);
bTimeB.mcBar.width = 100 / _maxTime * CREATURES.GetProperty(_monsterID,"cTime",_loc8_);
tSpeedB.htmlText = KEYS.Get("mon_att_speedvalue",{"v1":CREATURES.GetProperty(_monsterID,"speed",_loc8_)});
tHealthB.htmlText = CREATURES.GetProperty(_monsterID,"health",_loc8_).toString();
tHealthB.htmlText = CREATURES.GetProperty(_monsterID,"health",_loc8_).Get().toString();
if(!_loc7_)
{
tDamageB.htmlText = _loc6_.toString();
Expand All @@ -372,15 +372,15 @@ package
{
bSpeedB.mcBar.gotoAndStop(1);
}
if(CREATURES.GetProperty(_monsterID,"health") != CREATURES.GetProperty(_monsterID,"health",_loc8_))
if(CREATURES.GetProperty(_monsterID,"health").Get() != CREATURES.GetProperty(_monsterID,"health",_loc8_).Get())
{
bHealthB.mcBar.gotoAndStop(2);
}
else
{
bHealthB.mcBar.gotoAndStop(1);
}
if(CREATURES.GetProperty(_monsterID,"damage") != CREATURES.GetProperty(_monsterID,"damage",_loc8_))
if(CREATURES.GetProperty(_monsterID,"damage").Get() != CREATURES.GetProperty(_monsterID,"damage",_loc8_).Get())
{
bDamageB.mcBar.gotoAndStop(2);
}
Expand Down
2 changes: 1 addition & 1 deletion client/scripts/BASE.as
Original file line number Diff line number Diff line change
Expand Up @@ -1840,7 +1840,7 @@ package
{
if (Boolean(_buildingHealthData) && building.id in _buildingHealthData)
{
building.hp = _buildingHealthData[building.id];
building.hp.Set(_buildingHealthData[building.id]);
}
else if (MapRoomManager.instance.isInMapRoom3 && !BASE.isInfernoMainYardOrOutpost)
{
Expand Down
18 changes: 9 additions & 9 deletions client/scripts/BFOUNDATION.as
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ package
{
this._upgradeDescription = KEYS.Get("building_stats",{
"v1":this._buildingProps.stats[this._lvl.Get()].range,
"v2":this._buildingProps.stats[this._lvl.Get()].damage,
"v2":this._buildingProps.stats[this._lvl.Get()].damage.Get(),
"v3":this._buildingProps.stats[this._lvl.Get()].splash,
"v4":int(40 / this._buildingProps.stats[this._lvl.Get()].rate * 10) / 10
});
Expand Down Expand Up @@ -1940,7 +1940,7 @@ package
tmpBuildTime -= tmpBuildTime * 0.2;
}
this._countdownBuild.Set(tmpBuildTime);
setHealth(this._buildingProps.hp[0]);
setHealth(this._buildingProps.hp[0].Get());
maxHealthProperty.value = health;
this.PlaceB();
if(_mc.contains(this._mcHit))
Expand Down Expand Up @@ -2289,7 +2289,7 @@ package
if(!this._destroyed)
{
this._destroyed = true;
ATTACK.Damage(_mc.x,_mc.y,this._buildingProps.hp[this._lvl.Get() - 1]);
ATTACK.Damage(_mc.x,_mc.y,this._buildingProps.hp[this._lvl.Get() - 1].Get());
if(this._repairing == 1)
{
this._repairing = 0;
Expand All @@ -2301,15 +2301,15 @@ package
}
else if(this._countdownBuild.Get() > 0)
{
ATTACK.Damage(_mc.x,_mc.y,this._buildingProps.hp[this._lvl.Get()]);
ATTACK.Damage(_mc.x,_mc.y,this._buildingProps.hp[this._lvl.Get()].Get());
ATTACK.Log("b" + this._id,"<font color=\"#FF0000\">" + KEYS.Get("attack_log_downed_buildcancel",{
"v1":this._lvl.Get(),
"v2":KEYS.Get(this._buildingProps.name)
}) + "</font>");
}
else if(this._countdownUpgrade.Get())
{
ATTACK.Damage(_mc.x,_mc.y,this._buildingProps.hp[this._lvl.Get()]);
ATTACK.Damage(_mc.x,_mc.y,this._buildingProps.hp[this._lvl.Get()].Get());
_loc2_ = int(this._buildingProps.costs[this._lvl.Get()].time.Get() * GLOBAL._buildTime);
_loc3_ = (_loc2_ - this._countdownUpgrade.Get()) * 0.5;
if(_loc3_ > 60 * 60 * 8)
Expand Down Expand Up @@ -2863,7 +2863,7 @@ package
this._countdownUpgrade.Set(0);
this._lvl.Add(1);
++this._hpLvl;
maxHealthProperty.value = this._buildingProps.hp[this._lvl.Get() - 1];
maxHealthProperty.value = this._buildingProps.hp[this._lvl.Get() - 1].Get();
setHealth(maxHealth);
}
catch(e:Error)
Expand Down Expand Up @@ -2904,7 +2904,7 @@ package
this._countdownUpgrade.Set(0);
this._lvl.Add(-1);
--this._hpLvl;
maxHealthProperty.value = this._buildingProps.hp[this._lvl.Get() - 1];
maxHealthProperty.value = this._buildingProps.hp[this._lvl.Get() - 1].Get();
setHealth(maxHealth);
}
catch(e:Error)
Expand Down Expand Up @@ -3704,12 +3704,12 @@ package
this._hpLvl = this._lvl.Get();
if(this._lvl.Get() == 0)
{
maxHealthProperty.value = this._buildingProps.hp[0];
maxHealthProperty.value = this._buildingProps.hp[0].Get();
}
else
{
_loc5_ = this._lvl.Get();
_loc6_ = int(this._buildingProps.hp[_loc5_ - 1]);
_loc6_ = int(this._buildingProps.hp[_loc5_ - 1].Get());
maxHealthProperty.value = _loc6_;
}
if(building.hp == null)
Expand Down
4 changes: 2 additions & 2 deletions client/scripts/BHEAVYTRAP.as
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ package
_loc8_++;
_loc4_ = Number(_loc1_.dist);
_loc5_ = _loc1_.pos;
_loc2_.modifyHealth(-(_buildingProps.damage[0] / _buildingProps.size * (_buildingProps.size - _loc4_ * 0.5)));
_loc2_.modifyHealth(-(_buildingProps.damage[0].Get() / _buildingProps.size * (_buildingProps.size - _loc4_ * 0.5)));
if(_loc2_.health <= 0)
{
_loc9_++;
Expand All @@ -88,7 +88,7 @@ package
_loc8_++;
_loc4_ = Number(_loc1_.dist);
_loc5_ = _loc1_.pos;
_loc2_.modifyHealth(-(_buildingProps.damage[0] * 0.5 / _buildingProps.size * (_buildingProps.size - _loc4_ * 0.5)));
_loc2_.modifyHealth(-(_buildingProps.damage[0].Get() * 0.5 / _buildingProps.size * (_buildingProps.size - _loc4_ * 0.5)));
if(_loc2_.health <= 0)
{
_loc9_++;
Expand Down
8 changes: 4 additions & 4 deletions client/scripts/BTOWER.as
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ package
{
super._range = GLOBAL._buildingProps[_type - 1].stats[_lvl.Get() - 1].range;
}
damageProperty.value = GLOBAL._buildingProps[_type - 1].stats[_lvl.Get() - 1].damage;
damageProperty.value = GLOBAL._buildingProps[_type - 1].stats[_lvl.Get() - 1].damage.Get();
super._rate = GLOBAL._buildingProps[_type - 1].stats[_lvl.Get() - 1].rate;
super._splash = GLOBAL._buildingProps[_type - 1].stats[_lvl.Get() - 1].splash;
super._speed = GLOBAL._buildingProps[_type - 1].stats[_lvl.Get() - 1].speed;
Expand Down Expand Up @@ -159,11 +159,11 @@ package
"v2":_loc4_
}) + "<br>";
}
if(_loc1_.damage * (40 / _loc1_.rate) < _loc2_.damage * (40 / _loc2_.rate))
if(_loc1_.damage.Get() * (40 / _loc1_.rate) < _loc2_.damage.Get() * (40 / _loc2_.rate))
{
_upgradeDescription += KEYS.Get("bdg_tower_damageupgrade",{
"v1":int(_loc1_.damage * (40 / _loc1_.rate)),
"v2":int(_loc2_.damage * (40 / _loc2_.rate))
"v1":int(_loc1_.damage.Get() * (40 / _loc1_.rate)),
"v2":int(_loc2_.damage.Get() * (40 / _loc2_.rate))
}) + "<br>";
}
if(_loc1_.splash < _loc2_.splash)
Expand Down
2 changes: 1 addition & 1 deletion client/scripts/BTRAP.as
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ package
{
var _loc1_:RasterData = null;
super.SetProps();
damageProperty.value = _buildingProps.damage[0];
damageProperty.value = _buildingProps.damage[0].Get();
if(GLOBAL.mode != GLOBAL.e_BASE_MODE.BUILD)
{
_mc.visible = false;
Expand Down
6 changes: 3 additions & 3 deletions client/scripts/BUILDING115.as
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ package
"v2":_loc4_
}) + "<br>";
}
if(_loc1_.damage < _loc2_.damage)
if(_loc1_.damage.Get() < _loc2_.damage.Get())
{
_upgradeDescription += KEYS.Get("building_dpsincrease",{
"v1":_loc1_.damage,
"v2":_loc2_.damage
"v1":_loc1_.damage.Get(),
"v2":_loc2_.damage.Get()
}) + "<br>";
}
if(_lvl.Get() > 1)
Expand Down
4 changes: 2 additions & 2 deletions client/scripts/BUILDING22.as
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ package
return this._monsters[param1];
}
_loc2_ = this.numMonsters(param1);
_loc3_ = CREATURES.GetProperty(param1,"health",0,true);
_loc3_ = CREATURES.GetProperty(param1,"health",0,true).Get();
_loc4_ = _loc2_ - 1;
while(_loc4_ >= 0)
{
Expand All @@ -329,7 +329,7 @@ package
return null;
}
_loc2_ = int(this._monsters[param1].length);
_loc3_ = CREATURES.GetProperty(param1,"health",0,true);
_loc3_ = CREATURES.GetProperty(param1,"health",0,true).Get();
_loc4_ = 0;
while(_loc4_ < _loc2_)
{
Expand Down
6 changes: 3 additions & 3 deletions client/scripts/BUILDING25.as
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ package
"v2":_loc4_
}) + "<br>";
}
if(_loc1_.damage < _loc2_.damage)
if(_loc1_.damage.Get() < _loc2_.damage.Get())
{
_upgradeDescription += KEYS.Get("building_dpsincrease",{
"v1":_loc1_.damage,
"v2":_loc2_.damage
"v1":_loc1_.damage.Get(),
"v2":_loc2_.damage.Get()
}) + "<br>";
}
if(_loc1_.rate < _loc2_.rate)
Expand Down
Loading