diff options
author | Frans Bongers <fransbongers@macbookpro.home> | 2025-03-19 20:13:20 +0100 |
---|---|---|
committer | Frans Bongers <fransbongers@macbookpro.home> | 2025-03-19 20:13:20 +0100 |
commit | 188272eb9c875d82a9e87be91c98c1deabe6ea4b (patch) | |
tree | de2f8c28ebbb4663a9308b41cfd2c5091c6d116e | |
parent | 43751f0bdb0736cd2222fccc4c96af63369e4e4c (diff) | |
download | land-and-freedom-188272eb9c875d82a9e87be91c98c1deabe6ea4b.tar.gz |
removed code no longer needed for compatability
-rw-r--r-- | rules.js | 16 | ||||
-rw-r--r-- | rules.ts | 23 |
2 files changed, 17 insertions, 22 deletions
@@ -1176,13 +1176,11 @@ states.draw_glory = { const index = random(game.bag_of_glory.length); const faction = game.bag_of_glory[index]; game.glory.push(faction); - if (!game.glory_current_year) { - game.glory_current_year = game.glory_current_year = { - a: false, - c: false, - m: false, - }; - } + game.glory_current_year = game.glory_current_year = { + a: false, + c: false, + m: false, + }; game.glory_current_year[faction] = true; array_remove(game.bag_of_glory, index); logi(`Pulled T${faction} from the Bag`); @@ -2245,9 +2243,9 @@ function gain_hero_points(faction_id, value, skip_abilities = false) { } if (!skip_abilities && faction_id === data_1.ANARCHISTS_ID && - (game.active_abilities || []).includes(data_1.ANARCHIST_EXTRA_HERO_POINT)) { + game.active_abilities.includes(data_1.ANARCHIST_EXTRA_HERO_POINT)) { value++; - game.active_abilities = (game.active_abilities || []).filter((ability) => ability !== data_1.ANARCHIST_EXTRA_HERO_POINT); + array_remove(game.active_abilities, game.active_abilities.indexOf(data_1.ANARCHIST_EXTRA_HERO_POINT)); } if (!skip_abilities && faction_id === data_1.COMMUNISTS_ID && @@ -1468,15 +1468,12 @@ states.draw_glory = { game.glory.push(faction); - // TODO: remove if statement, just here atm to not break - // running games - if (!game.glory_current_year) { - game.glory_current_year = game.glory_current_year = { - a: false, - c: false, - m: false, - }; - } + game.glory_current_year = game.glory_current_year = { + a: false, + c: false, + m: false, + }; + game.glory_current_year[faction] = true; array_remove(game.bag_of_glory, index); @@ -2779,12 +2776,12 @@ function gain_hero_points( if ( !skip_abilities && faction_id === ANARCHISTS_ID && - // TODO: remove || [] and replace filter with array_remove - (game.active_abilities || []).includes(ANARCHIST_EXTRA_HERO_POINT) + game.active_abilities.includes(ANARCHIST_EXTRA_HERO_POINT) ) { value++; - game.active_abilities = (game.active_abilities || []).filter( - (ability) => ability !== ANARCHIST_EXTRA_HERO_POINT + array_remove( + game.active_abilities, + game.active_abilities.indexOf(ANARCHIST_EXTRA_HERO_POINT) ); } if ( |