diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-05-19 17:41:24 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-08-21 00:28:20 +0200 |
commit | 6595a0e76d5ee24f352c529cd82ceb794fa37697 (patch) | |
tree | b800b092dd24c57dfcc993aab8e02acf69f66bdf | |
parent | 427167da7870d5eea6cf7196322cd5bb1e7c7b94 (diff) | |
download | washingtons-war-6595a0e76d5ee24f352c529cd82ceb794fa37697.tar.gz |
stuff
-rw-r--r-- | about.html | 1 | ||||
-rw-r--r-- | play.css | 274 | ||||
-rw-r--r-- | play.js | 2 | ||||
-rw-r--r-- | rules.js | 41 |
4 files changed, 163 insertions, 155 deletions
@@ -5,4 +5,5 @@ Unlicensed game prototype! <ul> <li><a href="/washingtons-war/info/rulebook.html">Rulebook</a> <li><a href="/washingtons-war/info/playbook.html">Playbook</a> +<li><a href="/washingtons-war/info/cards.html">Cards</a> </ul> @@ -82,6 +82,12 @@ aside { } } +@media (max-height: 800px) { + #turn_info { + display: none; + } +} + /* CARD ACTION POPUP MENU */ #popup { max-width: 250px; } @@ -262,22 +268,26 @@ aside { /* CARDS */ .card { - background-position: -1px -1px; - background-size: 188.5px 264px; - width: 186px; - height: 262px; - border-radius: 10px; + width: 250px; + height: 350px; + background-size: 250px 350px; + border-radius: 15px; box-shadow: var(--piece-shadow); display: none; } +#turn_info .card { + width: 125px; + height: 175px; +} + .card.show { display: block; } #tooltip.card { background-position: center; - background-size: 377px 528px; + background-size: 500px 700px; width: 372px; height: 524px; border-radius: 20px; @@ -292,33 +302,32 @@ aside { left:1074px; top:1647px; position:absolute; - width: 186px; + width: 187px; height: 262px; - transform: rotate(90deg); - background-position: -1px -1px; - background-size: 188.5px 264px; + //transform: rotate(90deg); + background-size: 187px 262px; border-radius: 10px; - box-shadow: 2px -2px 8px rgba(0,0,0,0.5); + //box-shadow: 2px -2px 8px rgba(0,0,0,0.5); display: none; } #war_ends.year_1779 { - background-image:url('/washingtons-war/images/Card_71.jpg'); + background-image:url('/washingtons-war/cards75/WWcard-071.png'); display: block; } #war_ends.year_1780 { - background-image:url('/washingtons-war/images/Card_72.jpg'); + background-image:url('/washingtons-war/cards75/WWcard-072.png'); display: block; } #war_ends.year_1781 { - background-image:url('/washingtons-war/images/Card_73.jpg'); + background-image:url('/washingtons-war/cards75/WWcard-073.png'); display: block; } #war_ends.year_1782 { - background-image:url('/washingtons-war/images/Card_74.jpg'); + background-image:url('/washingtons-war/cards75/WWcard-074.png'); display: block; } #war_ends.year_1783 { - background-image:url('/washingtons-war/images/Card_75.jpg'); + background-image:url('/washingtons-war/cards75/WWcard-075.png'); display: block; } @@ -328,137 +337,134 @@ aside { .reinforcements { position:absolute; top: 1922px; - width: 186px; + width: 187px; height: 262px; - background-position: -1px -1px; - background-size: 188.5px 264px; border-radius: 10px; - box-shadow: 2px 2px 8px rgba(0,0,0,0.5); display: none; } .reinforcements.ops_1 { - background-image:url('/washingtons-war/images/Card_45-66.jpg'); + background-image:url('/washingtons-war/cards75/WWcard-045.png'); display: block; } .reinforcements.ops_2 { - background-image:url('/washingtons-war/images/Card_23-44.jpg'); + background-image:url('/washingtons-war/cards75/WWcard-023.png'); display: block; } .reinforcements.ops_3 { - background-image:url('/washingtons-war/images/Card_1-22.jpg'); + background-image:url('/washingtons-war/cards75/WWcard-001.png'); display: block; } /* IMAGES */ -.card_back{background-image:url('/washingtons-war/images/Card_Back.png')} -.card_1{background-image:url('/washingtons-war/images/Card_1-22.jpg')} -.card_2{background-image:url('/washingtons-war/images/Card_1-22.jpg')} -.card_3{background-image:url('/washingtons-war/images/Card_1-22.jpg')} -.card_4{background-image:url('/washingtons-war/images/Card_1-22.jpg')} -.card_5{background-image:url('/washingtons-war/images/Card_1-22.jpg')} -.card_6{background-image:url('/washingtons-war/images/Card_1-22.jpg')} -.card_7{background-image:url('/washingtons-war/images/Card_1-22.jpg')} -.card_8{background-image:url('/washingtons-war/images/Card_1-22.jpg')} -.card_9{background-image:url('/washingtons-war/images/Card_1-22.jpg')} -.card_10{background-image:url('/washingtons-war/images/Card_1-22.jpg')} -.card_11{background-image:url('/washingtons-war/images/Card_1-22.jpg')} -.card_12{background-image:url('/washingtons-war/images/Card_1-22.jpg')} -.card_13{background-image:url('/washingtons-war/images/Card_1-22.jpg')} -.card_14{background-image:url('/washingtons-war/images/Card_1-22.jpg')} -.card_15{background-image:url('/washingtons-war/images/Card_1-22.jpg')} -.card_16{background-image:url('/washingtons-war/images/Card_1-22.jpg')} -.card_17{background-image:url('/washingtons-war/images/Card_1-22.jpg')} -.card_18{background-image:url('/washingtons-war/images/Card_1-22.jpg')} -.card_19{background-image:url('/washingtons-war/images/Card_1-22.jpg')} -.card_20{background-image:url('/washingtons-war/images/Card_1-22.jpg')} -.card_21{background-image:url('/washingtons-war/images/Card_1-22.jpg')} -.card_22{background-image:url('/washingtons-war/images/Card_1-22.jpg')} -.card_23{background-image:url('/washingtons-war/images/Card_23-44.jpg')} -.card_24{background-image:url('/washingtons-war/images/Card_23-44.jpg')} -.card_25{background-image:url('/washingtons-war/images/Card_23-44.jpg')} -.card_26{background-image:url('/washingtons-war/images/Card_23-44.jpg')} -.card_27{background-image:url('/washingtons-war/images/Card_23-44.jpg')} -.card_28{background-image:url('/washingtons-war/images/Card_23-44.jpg')} -.card_29{background-image:url('/washingtons-war/images/Card_23-44.jpg')} -.card_30{background-image:url('/washingtons-war/images/Card_23-44.jpg')} -.card_31{background-image:url('/washingtons-war/images/Card_23-44.jpg')} -.card_32{background-image:url('/washingtons-war/images/Card_23-44.jpg')} -.card_33{background-image:url('/washingtons-war/images/Card_23-44.jpg')} -.card_34{background-image:url('/washingtons-war/images/Card_23-44.jpg')} -.card_35{background-image:url('/washingtons-war/images/Card_23-44.jpg')} -.card_36{background-image:url('/washingtons-war/images/Card_23-44.jpg')} -.card_37{background-image:url('/washingtons-war/images/Card_23-44.jpg')} -.card_38{background-image:url('/washingtons-war/images/Card_23-44.jpg')} -.card_39{background-image:url('/washingtons-war/images/Card_23-44.jpg')} -.card_40{background-image:url('/washingtons-war/images/Card_23-44.jpg')} -.card_41{background-image:url('/washingtons-war/images/Card_23-44.jpg')} -.card_42{background-image:url('/washingtons-war/images/Card_23-44.jpg')} -.card_43{background-image:url('/washingtons-war/images/Card_23-44.jpg')} -.card_44{background-image:url('/washingtons-war/images/Card_23-44.jpg')} -.card_45{background-image:url('/washingtons-war/images/Card_45-66.jpg')} -.card_46{background-image:url('/washingtons-war/images/Card_45-66.jpg')} -.card_47{background-image:url('/washingtons-war/images/Card_45-66.jpg')} -.card_48{background-image:url('/washingtons-war/images/Card_45-66.jpg')} -.card_49{background-image:url('/washingtons-war/images/Card_45-66.jpg')} -.card_50{background-image:url('/washingtons-war/images/Card_45-66.jpg')} -.card_51{background-image:url('/washingtons-war/images/Card_45-66.jpg')} -.card_52{background-image:url('/washingtons-war/images/Card_45-66.jpg')} -.card_53{background-image:url('/washingtons-war/images/Card_45-66.jpg')} -.card_54{background-image:url('/washingtons-war/images/Card_45-66.jpg')} -.card_55{background-image:url('/washingtons-war/images/Card_45-66.jpg')} -.card_56{background-image:url('/washingtons-war/images/Card_45-66.jpg')} -.card_57{background-image:url('/washingtons-war/images/Card_45-66.jpg')} -.card_58{background-image:url('/washingtons-war/images/Card_45-66.jpg')} -.card_59{background-image:url('/washingtons-war/images/Card_45-66.jpg')} -.card_60{background-image:url('/washingtons-war/images/Card_45-66.jpg')} -.card_61{background-image:url('/washingtons-war/images/Card_45-66.jpg')} -.card_62{background-image:url('/washingtons-war/images/Card_45-66.jpg')} -.card_63{background-image:url('/washingtons-war/images/Card_45-66.jpg')} -.card_64{background-image:url('/washingtons-war/images/Card_45-66.jpg')} -.card_65{background-image:url('/washingtons-war/images/Card_45-66.jpg')} -.card_66{background-image:url('/washingtons-war/images/Card_45-66.jpg')} -.card_67{background-image:url('/washingtons-war/images/Card_67-69.jpg')} -.card_68{background-image:url('/washingtons-war/images/Card_67-69.jpg')} -.card_69{background-image:url('/washingtons-war/images/Card_67-69.jpg')} -.card_70{background-image:url('/washingtons-war/images/Card_70.jpg')} -.card_71{background-image:url('/washingtons-war/images/Card_71.jpg')} -.card_72{background-image:url('/washingtons-war/images/Card_72.jpg')} -.card_73{background-image:url('/washingtons-war/images/Card_73.jpg')} -.card_74{background-image:url('/washingtons-war/images/Card_74.jpg')} -.card_75{background-image:url('/washingtons-war/images/Card_75.jpg')} -.card_76{background-image:url('/washingtons-war/images/Card_76.jpg')} -.card_77{background-image:url('/washingtons-war/images/Card_77.jpg')} -.card_78{background-image:url('/washingtons-war/images/Card_78.jpg')} -.card_79{background-image:url('/washingtons-war/images/Card_79.jpg')} -.card_80{background-image:url('/washingtons-war/images/Card_80.jpg')} -.card_81{background-image:url('/washingtons-war/images/Card_81.jpg')} -.card_82{background-image:url('/washingtons-war/images/Card_82.jpg')} -.card_83{background-image:url('/washingtons-war/images/Card_83.jpg')} -.card_84{background-image:url('/washingtons-war/images/Card_84.jpg')} -.card_85{background-image:url('/washingtons-war/images/Card_85.jpg')} -.card_86{background-image:url('/washingtons-war/images/Card_86.jpg')} -.card_87{background-image:url('/washingtons-war/images/Card_87.jpg')} -.card_88{background-image:url('/washingtons-war/images/Card_88.jpg')} -.card_89{background-image:url('/washingtons-war/images/Card_89.jpg')} -.card_90{background-image:url('/washingtons-war/images/Card_90.jpg')} -.card_91{background-image:url('/washingtons-war/images/Card_91.jpg')} -.card_92{background-image:url('/washingtons-war/images/Card_92.jpg')} -.card_93{background-image:url('/washingtons-war/images/Card_93.jpg')} -.card_94{background-image:url('/washingtons-war/images/Card_94.jpg')} -.card_95{background-image:url('/washingtons-war/images/Card_95.jpg')} -.card_96{background-image:url('/washingtons-war/images/Card_96.jpg')} -.card_97{background-image:url('/washingtons-war/images/Card_97.jpg')} -.card_98{background-image:url('/washingtons-war/images/Card_98.jpg')} -.card_99{background-image:url('/washingtons-war/images/Card_99.jpg')} -.card_100{background-image:url('/washingtons-war/images/Card_100.jpg')} -.card_101{background-image:url('/washingtons-war/images/Card_101.jpg')} -.card_102{background-image:url('/washingtons-war/images/Card_102.jpg')} -.card_103{background-image:url('/washingtons-war/images/Card_103.jpg')} -.card_104{background-image:url('/washingtons-war/images/Card_104.jpg')} -.card_105{background-image:url('/washingtons-war/images/Card_105.jpg')} -.card_106{background-image:url('/washingtons-war/images/Card_106.jpg')} -.card_107{background-image:url('/washingtons-war/images/Card_107.jpg')} -.card_108{background-image:url('/washingtons-war/images/Card_108.jpg')} -.card_109{background-image:url('/washingtons-war/images/Card_109.jpg')} -.card_110{background-image:url('/washingtons-war/images/Card_110.jpg')} +.card_back{background-image:url(/washingtons-war/cards100/WW-CardBack.png)} +.card_1{background-image:url(/washingtons-war/cards100/WWcard-001.png)} +.card_2{background-image:url(/washingtons-war/cards100/WWcard-001.png)} +.card_3{background-image:url(/washingtons-war/cards100/WWcard-001.png)} +.card_4{background-image:url(/washingtons-war/cards100/WWcard-001.png)} +.card_5{background-image:url(/washingtons-war/cards100/WWcard-001.png)} +.card_6{background-image:url(/washingtons-war/cards100/WWcard-001.png)} +.card_7{background-image:url(/washingtons-war/cards100/WWcard-001.png)} +.card_8{background-image:url(/washingtons-war/cards100/WWcard-001.png)} +.card_9{background-image:url(/washingtons-war/cards100/WWcard-001.png)} +.card_10{background-image:url(/washingtons-war/cards100/WWcard-01.png)} +.card_11{background-image:url(/washingtons-war/cards100/WWcard-001.png)} +.card_12{background-image:url(/washingtons-war/cards100/WWcard-001.png)} +.card_13{background-image:url(/washingtons-war/cards100/WWcard-001.png)} +.card_14{background-image:url(/washingtons-war/cards100/WWcard-001.png)} +.card_15{background-image:url(/washingtons-war/cards100/WWcard-001.png)} +.card_16{background-image:url(/washingtons-war/cards100/WWcard-001.png)} +.card_17{background-image:url(/washingtons-war/cards100/WWcard-001.png)} +.card_18{background-image:url(/washingtons-war/cards100/WWcard-001.png)} +.card_19{background-image:url(/washingtons-war/cards100/WWcard-001.png)} +.card_20{background-image:url(/washingtons-war/cards100/WWcard-001.png)} +.card_21{background-image:url(/washingtons-war/cards100/WWcard-001.png)} +.card_22{background-image:url(/washingtons-war/cards100/WWcard-001.png)} +.card_23{background-image:url(/washingtons-war/cards100/WWcard-023.png)} +.card_24{background-image:url(/washingtons-war/cards100/WWcard-023.png)} +.card_25{background-image:url(/washingtons-war/cards100/WWcard-023.png)} +.card_26{background-image:url(/washingtons-war/cards100/WWcard-023.png)} +.card_27{background-image:url(/washingtons-war/cards100/WWcard-023.png)} +.card_28{background-image:url(/washingtons-war/cards100/WWcard-023.png)} +.card_29{background-image:url(/washingtons-war/cards100/WWcard-023.png)} +.card_30{background-image:url(/washingtons-war/cards100/WWcard-023.png)} +.card_31{background-image:url(/washingtons-war/cards100/WWcard-023.png)} +.card_32{background-image:url(/washingtons-war/cards100/WWcard-023.png)} +.card_33{background-image:url(/washingtons-war/cards100/WWcard-023.png)} +.card_34{background-image:url(/washingtons-war/cards100/WWcard-023.png)} +.card_35{background-image:url(/washingtons-war/cards100/WWcard-023.png)} +.card_36{background-image:url(/washingtons-war/cards100/WWcard-023.png)} +.card_37{background-image:url(/washingtons-war/cards100/WWcard-023.png)} +.card_38{background-image:url(/washingtons-war/cards100/WWcard-023.png)} +.card_39{background-image:url(/washingtons-war/cards100/WWcard-023.png)} +.card_40{background-image:url(/washingtons-war/cards100/WWcard-023.png)} +.card_41{background-image:url(/washingtons-war/cards100/WWcard-023.png)} +.card_42{background-image:url(/washingtons-war/cards100/WWcard-023.png)} +.card_43{background-image:url(/washingtons-war/cards100/WWcard-023.png)} +.card_44{background-image:url(/washingtons-war/cards100/WWcard-023.png)} +.card_45{background-image:url(/washingtons-war/cards100/WWcard-045.png)} +.card_46{background-image:url(/washingtons-war/cards100/WWcard-045.png)} +.card_47{background-image:url(/washingtons-war/cards100/WWcard-045.png)} +.card_48{background-image:url(/washingtons-war/cards100/WWcard-045.png)} +.card_49{background-image:url(/washingtons-war/cards100/WWcard-045.png)} +.card_50{background-image:url(/washingtons-war/cards100/WWcard-045.png)} +.card_51{background-image:url(/washingtons-war/cards100/WWcard-045.png)} +.card_52{background-image:url(/washingtons-war/cards100/WWcard-045.png)} +.card_53{background-image:url(/washingtons-war/cards100/WWcard-045.png)} +.card_54{background-image:url(/washingtons-war/cards100/WWcard-045.png)} +.card_55{background-image:url(/washingtons-war/cards100/WWcard-045.png)} +.card_56{background-image:url(/washingtons-war/cards100/WWcard-045.png)} +.card_57{background-image:url(/washingtons-war/cards100/WWcard-045.png)} +.card_58{background-image:url(/washingtons-war/cards100/WWcard-045.png)} +.card_59{background-image:url(/washingtons-war/cards100/WWcard-045.png)} +.card_60{background-image:url(/washingtons-war/cards100/WWcard-045.png)} +.card_61{background-image:url(/washingtons-war/cards100/WWcard-045.png)} +.card_62{background-image:url(/washingtons-war/cards100/WWcard-045.png)} +.card_63{background-image:url(/washingtons-war/cards100/WWcard-045.png)} +.card_64{background-image:url(/washingtons-war/cards100/WWcard-045.png)} +.card_65{background-image:url(/washingtons-war/cards100/WWcard-045.png)} +.card_66{background-image:url(/washingtons-war/cards100/WWcard-045.png)} +.card_67{background-image:url(/washingtons-war/cards100/WWcard-067.png)} +.card_68{background-image:url(/washingtons-war/cards100/WWcard-067.png)} +.card_69{background-image:url(/washingtons-war/cards100/WWcard-067.png)} +.card_70{background-image:url(/washingtons-war/cards100/WWcard-070.png)} +.card_71{background-image:url(/washingtons-war/cards100/WWcard-071.png)} +.card_72{background-image:url(/washingtons-war/cards100/WWcard-072.png)} +.card_73{background-image:url(/washingtons-war/cards100/WWcard-073.png)} +.card_74{background-image:url(/washingtons-war/cards100/WWcard-074.png)} +.card_75{background-image:url(/washingtons-war/cards100/WWcard-075.png)} +.card_76{background-image:url(/washingtons-war/cards100/WWcard-076.png)} +.card_77{background-image:url(/washingtons-war/cards100/WWcard-077.png)} +.card_78{background-image:url(/washingtons-war/cards100/WWcard-078.png)} +.card_79{background-image:url(/washingtons-war/cards100/WWcard-079.png)} +.card_80{background-image:url(/washingtons-war/cards100/WWcard-080.png)} +.card_81{background-image:url(/washingtons-war/cards100/WWcard-081.png)} +.card_82{background-image:url(/washingtons-war/cards100/WWcard-082.png)} +.card_83{background-image:url(/washingtons-war/cards100/WWcard-083.png)} +.card_84{background-image:url(/washingtons-war/cards100/WWcard-084.png)} +.card_85{background-image:url(/washingtons-war/cards100/WWcard-085.png)} +.card_86{background-image:url(/washingtons-war/cards100/WWcard-086.png)} +.card_87{background-image:url(/washingtons-war/cards100/WWcard-087.png)} +.card_88{background-image:url(/washingtons-war/cards100/WWcard-088.png)} +.card_89{background-image:url(/washingtons-war/cards100/WWcard-089.png)} +.card_90{background-image:url(/washingtons-war/cards100/WWcard-090.png)} +.card_91{background-image:url(/washingtons-war/cards100/WWcard-091.png)} +.card_92{background-image:url(/washingtons-war/cards100/WWcard-092.png)} +.card_93{background-image:url(/washingtons-war/cards100/WWcard-093.png)} +.card_94{background-image:url(/washingtons-war/cards100/WWcard-094.png)} +.card_95{background-image:url(/washingtons-war/cards100/WWcard-095.png)} +.card_96{background-image:url(/washingtons-war/cards100/WWcard-096.png)} +.card_97{background-image:url(/washingtons-war/cards100/WWcard-097.png)} +.card_98{background-image:url(/washingtons-war/cards100/WWcard-098.png)} +.card_99{background-image:url(/washingtons-war/cards100/WWcard-099.png)} +.card_100{background-image:url(/washingtons-war/cards100/WWcard-100.png)} +.card_101{background-image:url(/washingtons-war/cards100/WWcard-101.png)} +.card_102{background-image:url(/washingtons-war/cards100/WWcard-102.png)} +.card_103{background-image:url(/washingtons-war/cards100/WWcard-103.png)} +.card_104{background-image:url(/washingtons-war/cards100/WWcard-104.png)} +.card_105{background-image:url(/washingtons-war/cards100/WWcard-105.png)} +.card_106{background-image:url(/washingtons-war/cards100/WWcard-106.png)} +.card_107{background-image:url(/washingtons-war/cards100/WWcard-107.png)} +.card_108{background-image:url(/washingtons-war/cards100/WWcard-108.png)} +.card_109{background-image:url(/washingtons-war/cards100/WWcard-109.png)} +.card_110{background-image:url(/washingtons-war/cards100/WWcard-110.png)} @@ -414,7 +414,7 @@ function on_update() { e.classList.remove("year_1782") e.classList.remove("year_1783") if (view.war_ends) - e.classList.add("year_" + view.war_ends) + e.classList.add("year_" + CARDS[view.war_ends].year) e = document.getElementById("played_british_reinforcements") e.classList.remove("ops_1") @@ -930,7 +930,7 @@ function overrun(where) { function retreat_american_army(from, to) { let g = find_american_or_french_general(from) - if (g) + if (g !== NOBODY) move_general(g, to) move_american_cu(from, to, count_american_cu(from)) move_french_cu(from, to, count_french_cu(from)) @@ -938,14 +938,14 @@ function retreat_american_army(from, to) { function retreat_british_army(from, to) { let g = find_british_general(from) - if (g) + if (g !== NOBODY) move_general(g, to) move_british_cu(from, to, count_british_cu(from)) } function surrender_american_army(where) { let g = find_american_or_french_general(where) - if (g) + if (g !== NOBODY) capture_american_or_french_general(where) remove_american_cu(where, count_american_cu(where)) remove_french_cu(where, count_french_cu(where)) @@ -953,7 +953,7 @@ function surrender_american_army(where) { function surrender_british_army(where) { let g = find_british_general(where) - if (g) + if (g !== NOBODY) capture_british_general(where) game.combat.british_losses += count_british_cu(where) remove_british_cu(where, count_british_cu(where)) @@ -1991,7 +1991,6 @@ states.ops_general_move = { function resume_moving() { if (has_enemy_cu(game.move.to)) { - end_move() goto_start_battle() } } @@ -2698,7 +2697,6 @@ function goto_start_battle() { function goto_retreat_before_battle() { game.active = P_AMERICA - game.who = find_american_or_french_general(game.move.to) game.state = "retreat_before_battle" } @@ -2709,14 +2707,15 @@ states.retreat_before_battle = { gen_defender_retreat() }, move(to) { - let agility = GENERALS[game.who].agility - if (GENERALS[game.who].bonus) + let who = find_american_or_french_general(game.move.to) + let agility = GENERALS[who].agility + if (GENERALS[who].bonus) agility += 2 let roll = roll_d6() if (roll <= agility) { logp("successfully retreated before battle: " + roll + " <= " + agility) pickup_max_american_cu(game.move.to) - move_army(game.who, game.move.to, to) + move_army(who, game.move.to, to) goto_remove_general_after_retreat_before_battle(to) } else { logp("failed to retreat before battle: " + roll + " > " + agility) @@ -2817,7 +2816,6 @@ function gen_attacker_retreat() { } function end_retreat_before_battle() { - delete game.who goto_play_attacker_battle_card() } @@ -3134,12 +3132,12 @@ function resolve_battle() { function goto_retreat_after_battle(victor) { if (victor === P_BRITAIN) { - game.who = find_american_or_french_general(game.move.to) - if (game.who === NOBODY && count_american_and_french_cu(game.move.to) === 0) + let who = find_american_or_french_general(game.move.to) + if (who === NOBODY && count_american_and_french_cu(game.move.to) === 0) return end_battle() } else { - game.who = find_british_general(game.move.to) - if (game.who === NOBODY && count_british_cu(game.move.to) === 0) + let who = find_british_general(game.move.to) + if (who === NOBODY && count_british_cu(game.move.to) === 0) return end_battle() } game.active = ENEMY[victor] @@ -3196,7 +3194,8 @@ function end_battle() { set_add(game.a_hand, deal_card()) delete game.combat - delete game.move + + end_move() end_strategy_card() } @@ -3535,7 +3534,7 @@ states.game_over = { function gen_action(action, argument) { if (argument === undefined) { - view.actions.action = 1 + view.actions[action] = 1 } else { if (!(action in view.actions)) view.actions[action] = [] @@ -3559,7 +3558,7 @@ exports.setup = function (seed, scenario, options) { exports.action = function (state, current, action, arg) { game = state - Object.seal(game) // don't allow adding properties! + //Object.seal(game) // don't allow adding properties! // TODO: check against action list if (current === game.active) { @@ -3581,8 +3580,10 @@ exports.view = function (state, current) { game = state view = { + prompt: null, + log: state.log, year: state.year, - flags: state,flags + flags: state.flags, war_ends: state.war_ends, reinforcements: state.reinforcements, french_alliance: state.french_alliance, @@ -3597,8 +3598,6 @@ exports.view = function (state, current) { a_queue: state.a_queue, b_queue: state.b_queue, last_played: state.last_played, - who: state.who, - log: state.log, } if (current === P_AMERICA) @@ -3918,3 +3917,5 @@ function map_delete(map, key) { } } } + +console.log(events) |