Skip to content

Commit

Permalink
fix: minor patches
Browse files Browse the repository at this point in the history
  • Loading branch information
trevelyan committed Jan 23, 2024
1 parent b0233a9 commit 76270a4
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 20 deletions.
44 changes: 34 additions & 10 deletions mods/his/his.js
Original file line number Diff line number Diff line change
Expand Up @@ -28395,17 +28395,39 @@ return;

let space = his_self.game.spaces[spacekey];

his_self.field_battle_overlay.hide();

his_self.playerSelectSpaceWithFilter(

"Choose Destination for Retreat:" ,

function(space2) {
if (space.neighbours.includes(space2.key)) {
if (loser === attacker) {
if (space2.key === attacker_comes_from_this_spacekey) {
return 1;
}
} else {
if (his_self.canFactionRetreatToSpace(loser, space2.key, "") && space2.key !== attacker_comes_from_this_spacekey) {
return 1;
}
}
}
},

function(spacekey) {
onFinishSelect(his_self, spacekey);
},

null,

true

);

/****

let html = "<ul>";
for (let i = 0; i < space.neighbours.length; i++) {
if (loser === attacker) {
if (space.neighbours[i] === attacker_comes_from_this_spacekey) {
html += `<li class="option" id="${space.neighbours[i]}">${his_self.game.spaces[space.neighbours[i]].key}</li>`;
}
} else {
if (his_self.canFactionRetreatToSpace(loser, space.neighbours[i], "") && space.neighbours[i] !== attacker_comes_from_this_spacekey) {
html += `<li class="option" id="${space.neighbours[i]}">${his_self.game.spaces[space.neighbours[i]].key}</li>`;
}
}
}
html += "</ul>";

Expand All @@ -28417,6 +28439,8 @@ return;
onFinishSelect(his_self, id);
});

***/

};


Expand Down
44 changes: 34 additions & 10 deletions mods/his/src/his-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -2876,17 +2876,39 @@ return;

let space = his_self.game.spaces[spacekey];

his_self.field_battle_overlay.hide();

his_self.playerSelectSpaceWithFilter(

"Choose Destination for Retreat:" ,

function(space2) {
if (space.neighbours.includes(space2.key)) {
if (loser === attacker) {
if (space2.key === attacker_comes_from_this_spacekey) {
return 1;
}
} else {
if (his_self.canFactionRetreatToSpace(loser, space2.key, "") && space2.key !== attacker_comes_from_this_spacekey) {
return 1;
}
}
}
},

function(spacekey) {
onFinishSelect(his_self, spacekey);
},

null,

true

);

/****
let html = "<ul>";
for (let i = 0; i < space.neighbours.length; i++) {
if (loser === attacker) {
if (space.neighbours[i] === attacker_comes_from_this_spacekey) {
html += `<li class="option" id="${space.neighbours[i]}">${his_self.game.spaces[space.neighbours[i]].key}</li>`;
}
} else {
if (his_self.canFactionRetreatToSpace(loser, space.neighbours[i], "") && space.neighbours[i] !== attacker_comes_from_this_spacekey) {
html += `<li class="option" id="${space.neighbours[i]}">${his_self.game.spaces[space.neighbours[i]].key}</li>`;
}
}
}
html += "</ul>";
Expand All @@ -2898,6 +2920,8 @@ return;
onFinishSelect(his_self, id);
});
***/

};


Expand Down

0 comments on commit 76270a4

Please sign in to comment.