Skip to content
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

Mercenary #1448

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
1 change: 1 addition & 0 deletions d2bs/kolbot/default.dbj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ include("common/Precast.js");
include("common/Prototypes.js");
include("common/Runewords.js");
include("common/Storage.js");
include("common/Mercenary.js");
include("common/Town.js");

function main() {
Expand Down
2 changes: 1 addition & 1 deletion d2bs/kolbot/libs/GameAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ var GameAction = {

if (this.LogMerc) {
for (i = 0; i < 3; i += 1) {
merc = me.getMerc();
merc = Mercenary.getMerc();

if (merc) {
break;
Expand Down
2 changes: 1 addition & 1 deletion d2bs/kolbot/libs/MuleLogger.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ var MuleLogger = {

if (this.LogMerc) {
for (i = 0; i < 3; i += 1) {
merc = me.getMerc();
merc = Mercenary.getMerc();

if (merc) {
break;
Expand Down
2 changes: 1 addition & 1 deletion d2bs/kolbot/libs/common/Attack.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ var Attack = {
var i, merc, item;

for (i = 0; i < 3; i += 1) {
merc = me.getMerc();
merc = Mercenary.getMerc();

if (merc) {
break;
Expand Down
6 changes: 3 additions & 3 deletions d2bs/kolbot/libs/common/Attacks/Amazon.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var ClassAttack = {
doAttack: function (unit, preattack) {
var needRepair = Town.needRepair();

if ((Config.MercWatch && Town.needMerc()) || needRepair.length > 0) {
if ((Config.MercWatch && Mercenary.needMerc()) || needRepair.length > 0) {
Town.visitTown(!!needRepair.length);
}

Expand Down Expand Up @@ -74,7 +74,7 @@ var ClassAttack = {

if (result === 2 && Config.TeleStomp && Attack.checkResist(unit, "physical") && !!me.getMerc()) {
while (Attack.checkMonster(unit)) {
if (Town.needMerc()) {
if (Mercenary.needMerc()) {
if (Config.MercWatch && mercRevive++ < 1) {
Town.visitTown();
} else {
Expand Down Expand Up @@ -213,4 +213,4 @@ var ClassAttack = {

return 1;
}
};
};
4 changes: 2 additions & 2 deletions d2bs/kolbot/libs/common/Attacks/Assassin.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var ClassAttack = {
trapRange: 20,

doAttack: function (unit, preattack) {
if (Config.MercWatch && Town.needMerc()) {
if (Config.MercWatch && Mercenary.needMerc()) {
Town.visitTown();
}

Expand Down Expand Up @@ -98,7 +98,7 @@ var ClassAttack = {

if (result === 2 && Config.TeleStomp && Attack.checkResist(unit, "physical") && !!me.getMerc()) {
while (Attack.checkMonster(unit)) {
if (Town.needMerc()) {
if (Mercenary.needMerc()) {
if (Config.MercWatch && mercRevive++ < 1) {
Town.visitTown();
} else {
Expand Down
2 changes: 1 addition & 1 deletion d2bs/kolbot/libs/common/Attacks/Barbarian.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var ClassAttack = {
doAttack: function (unit, preattack) {
var needRepair = Town.needRepair();

if ((Config.MercWatch && Town.needMerc()) || needRepair.length > 0) {
if ((Config.MercWatch && Mercenary.needMerc()) || needRepair.length > 0) {
Town.visitTown(!!needRepair.length);
}

Expand Down
4 changes: 2 additions & 2 deletions d2bs/kolbot/libs/common/Attacks/Druid.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

var ClassAttack = {
doAttack: function (unit, preattack) {
if (Config.MercWatch && Town.needMerc()) {
if (Config.MercWatch && Mercenary.needMerc()) {
Town.visitTown();
}

Expand Down Expand Up @@ -77,7 +77,7 @@ var ClassAttack = {

if (result === 2 && Config.TeleStomp && Attack.checkResist(unit, "physical") && !!me.getMerc()) {
while (Attack.checkMonster(unit)) {
if (Town.needMerc()) {
if (Mercenary.needMerc()) {
if (Config.MercWatch && mercRevive++ < 1) {
Town.visitTown();
} else {
Expand Down
4 changes: 2 additions & 2 deletions d2bs/kolbot/libs/common/Attacks/Necromancer.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ var ClassAttack = {
this.initCurses();
}

if (Config.MercWatch && Town.needMerc()) {
if (Config.MercWatch && Mercenary.needMerc()) {
Town.visitTown();
}

Expand Down Expand Up @@ -167,7 +167,7 @@ var ClassAttack = {
this.explodeCorpses(unit);
} else if (result === 2 && Config.TeleStomp && Attack.checkResist(unit, "physical") && !!me.getMerc()) {
while (Attack.checkMonster(unit)) {
if (Town.needMerc()) {
if (Mercenary.needMerc()) {
if (Config.MercWatch && mercRevive++ < 1) {
Town.visitTown();
} else {
Expand Down
4 changes: 2 additions & 2 deletions d2bs/kolbot/libs/common/Attacks/Paladin.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

var ClassAttack = {
doAttack: function (unit, preattack) {
if (Config.MercWatch && Town.needMerc()) {
if (Config.MercWatch && Mercenary.needMerc()) {
print("mercwatch");
Town.visitTown();
}
Expand Down Expand Up @@ -61,7 +61,7 @@ var ClassAttack = {

if (result === 2 && Config.TeleStomp && Attack.checkResist(unit, "physical") && !!me.getMerc()) {
while (Attack.checkMonster(unit)) {
if (Town.needMerc()) {
if (Mercenary.needMerc()) {
if (Config.MercWatch && mercRevive++ < 1) {
Town.visitTown();
} else {
Expand Down
4 changes: 2 additions & 2 deletions d2bs/kolbot/libs/common/Attacks/Sorceress.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

var ClassAttack = {
doAttack: function (unit, preattack) {
if (Config.MercWatch && Town.needMerc()) {
if (Config.MercWatch && Mercenary.needMerc()) {
print("mercwatch");
Town.visitTown();
}
Expand Down Expand Up @@ -114,7 +114,7 @@ var ClassAttack = {

if (result === 2 && Config.TeleStomp && Attack.checkResist(unit, "physical") && !!me.getMerc() && Attack.validSpot(unit.x, unit.y)) {
while (Attack.checkMonster(unit)) {
if (Town.needMerc()) {
if (Mercenary.needMerc()) {
if (Config.MercWatch && mercRevive++ < 1) {
Town.visitTown();
} else {
Expand Down
4 changes: 2 additions & 2 deletions d2bs/kolbot/libs/common/Attacks/Wereform.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

var ClassAttack = {
doAttack: function (unit, preattack) {
if (Config.MercWatch && Town.needMerc()) {
if (Config.MercWatch && Mercenary.needMerc()) {
Town.visitTown();
}

Expand Down Expand Up @@ -69,7 +69,7 @@ var ClassAttack = {

if (result === 2 && Config.TeleStomp && Attack.checkResist(unit, "physical") && !!me.getMerc()) {
while (Attack.checkMonster(unit)) {
if (Town.needMerc()) {
if (Mercenary.needMerc()) {
if (Config.MercWatch && mercRevive++ < 1) {
Town.visitTown();
} else {
Expand Down
Loading