From 1f3e8f7fcc6c283bfe31240475cdff3d5fc6b7fd Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 28 Jul 2022 17:23:28 +0200 Subject: Refit & queue locations. --- data.js | 2 +- play.js | 5 ++++- rules.js | 56 ++++++++++++++++++++++++++++++++++++++++++++++++-------- tools/gendata.js | 6 +++++- 4 files changed, 58 insertions(+), 11 deletions(-) diff --git a/data.js b/data.js index a68112a..87dd052 100644 --- a/data.js +++ b/data.js @@ -3,7 +3,7 @@ const hex_exists = [0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, const hex_road = [0,0,0,0,0,0,0,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,1,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,1,1,2,2,2,4,4,2,4,4,4,4,4,4,4,4,4,4,4,0,0,0,4,2,2,2,2,2,0,1,2,2,2,2,0,1,0,2,0,0,0,2,0,0,0,0,0,4,2,0,1,1,0,1,0,0,1,2,1,1,0,2,0,0,0,2,0,0,0,0,0,0,4,1,1,0,0,1,0,0,0,1,1,1,1,2,0,0,0,0,0,0,0,0,0,4,4,1,0,0,0,1,0,0,0,0,1,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,1,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0] const side_road = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,4,4,0,0,4,0,4,0,4,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,4,4,0,4,4,0,0,0,0,0,0,0,1,4,1,2,4,4,0,4,2,0,4,0,4,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,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,2,2,2,2,2,2,2,0,0,2,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] -const hex_name = {"7":"El Garib","8":"Cyrene","9":"El Gubba","10":"Derna","30":"Tocra","31":"Barce","32":"Marawa","33":"Wadi Cuff","34":"Wadi Cuff E","35":"Gazala","36":"Acroma","37":"Tobruk","38":"Belhamed","39":"Gambut","40":"Bardia","54":"Benghazi","55":"Er Regima","56":"Charruba","57":"Charruba E","58":"Mechili","59":"Rotonda Segnali","60":"Sidi Mufta","61":"Bir Harmat","62":"El Adem","63":"Sidi Rezegh","64":"Ft. Capuzzo","65":"Sollum","66":"Buq Buq","67":"Sidi Barrani","68":"Sidi Barrani E","69":"Mersa Matruh","70":"Fuka","71":"El Daba","72":"El Alamein","73":"El Hamam","74":"Alexandria","78":"Ghemines","79":"Skeleidima","80":"Msus","81":"Msus E","82":"Tengeder W","83":"Tengeder","84":"Tengeder E","85":"Bir Hacheim","86":"Retma","87":"Bir Gubi","88":"Gabr Saleh","89":"Sidi Omar","90":"Bir Habata","91":"Sofafi","92":"Sofafi E","93":"Bir el Kenayis","94":"Bir Khalda","95":"Bir Khalda E","96":"Alam Halfa W","97":"Alam Halfa","98":"Alam Halfa E","99":"Map Edge","103":"Beda Fomm","104":"Antelat","105":"Antelat E","106":"Ben Gania","107":"Ben Gania E","108":"Tengeder SE","109":"Bir Hacheim SW","110":"Bir Hacheim SE","111":"Retma SE","112":"Ft. Maddalena W","113":"Ft. Maddalena","114":"Ft. Maddalena E","115":"Bir Khamsa","116":"Bir el Qatrani","117":"Bir el Qatrani E","118":"Bir el Kenayis SE","119":"Bir Khalda SE","120":"El Himeimat W","121":"El Himeimat","122":"El Himeimat E","123":"Map Edge","128":"Agedabia","129":"Jebel el Matar","130":"Haraga","131":"Haraga E","137":"Ft. Maddalena SW","138":"Ft. Maddalena SE","139":"Bir Khamsa SW","140":"Bir Fuad W","141":"Bir Fuad","142":"Bir Fuad E","147":"El Himeimat E SE","148":"Map Edge","151":"El Agheila","152":"Mersa Brega","153":"El Haseiat","154":"El Haseiat E","155":"Haraga SE","162":"Jarabub Oasis NW","163":"Jarabub Oasis NE","165":"Bir Fuad SW","166":"Bir Fuad SE","172":"Map Edge","176":"Maaten Giofer","177":"Maaten Giofer E","178":"Sahaba","179":"Sahaba E","180":"Jalo Oasis NE","186":"Jarabub Oasis W","187":"Jarabub Oasis","188":"Jarabub Oasis E","189":"Siwa Oasis NE","197":"Map Edge","200":"Maaten Giofer SW","201":"Maaten Giofer SE","202":"Sahaba SW","203":"Jalo Oasis W","204":"Jalo Oasis","205":"Jalo Oasis E","211":"Jarabub Oasis SW","212":"Siwa Oasis W","213":"Siwa Oasis","214":"Siwa Oasis E"} +const hex_name = {"7":"El Garib","8":"Cyrene","9":"El Gubba","10":"Derna","30":"Tocra","31":"Barce","32":"Marawa","33":"Wadi Cuff","34":"Wadi Cuff E","35":"Gazala","36":"Acroma","37":"Tobruk","38":"Belhamed","39":"Gambut","40":"Bardia","48":"Alexandria Refit","49":"Alexandria Queue","54":"Benghazi","55":"Er Regima","56":"Charruba","57":"Charruba E","58":"Mechili","59":"Rotonda Segnali","60":"Sidi Mufta","61":"Bir Harmat","62":"El Adem","63":"Sidi Rezegh","64":"Ft. Capuzzo","65":"Sollum","66":"Buq Buq","67":"Sidi Barrani","68":"Sidi Barrani E","69":"Mersa Matruh","70":"Fuka","71":"El Daba","72":"El Alamein","73":"El Hamam","74":"Alexandria","78":"Ghemines","79":"Skeleidima","80":"Msus","81":"Msus E","82":"Tengeder W","83":"Tengeder","84":"Tengeder E","85":"Bir Hacheim","86":"Retma","87":"Bir Gubi","88":"Gabr Saleh","89":"Sidi Omar","90":"Bir Habata","91":"Sofafi","92":"Sofafi E","93":"Bir el Kenayis","94":"Bir Khalda","95":"Bir Khalda E","96":"Alam Halfa W","97":"Alam Halfa","98":"Alam Halfa E","99":"Map Edge","102":"El Agheila Refit","103":"Beda Fomm","104":"Antelat","105":"Antelat E","106":"Ben Gania","107":"Ben Gania E","108":"Tengeder SE","109":"Bir Hacheim SW","110":"Bir Hacheim SE","111":"Retma SE","112":"Ft. Maddalena W","113":"Ft. Maddalena","114":"Ft. Maddalena E","115":"Bir Khamsa","116":"Bir el Qatrani","117":"Bir el Qatrani E","118":"Bir el Kenayis SE","119":"Bir Khalda SE","120":"El Himeimat W","121":"El Himeimat","122":"El Himeimat E","123":"Map Edge","127":"El Agheila Queue","128":"Agedabia","129":"Jebel el Matar","130":"Haraga","131":"Haraga E","137":"Ft. Maddalena SW","138":"Ft. Maddalena SE","139":"Bir Khamsa SW","140":"Bir Fuad W","141":"Bir Fuad","142":"Bir Fuad E","147":"El Himeimat E SE","148":"Map Edge","151":"El Agheila","152":"Mersa Brega","153":"El Haseiat","154":"El Haseiat E","155":"Haraga SE","162":"Jarabub Oasis NW","163":"Jarabub Oasis NE","165":"Bir Fuad SW","166":"Bir Fuad SE","172":"Map Edge","176":"Maaten Giofer","177":"Maaten Giofer E","178":"Sahaba","179":"Sahaba E","180":"Jalo Oasis NE","186":"Jarabub Oasis W","187":"Jarabub Oasis","188":"Jarabub Oasis E","189":"Siwa Oasis NE","197":"Map Edge","200":"Maaten Giofer SW","201":"Maaten Giofer SE","202":"Sahaba SW","203":"Jalo Oasis W","204":"Jalo Oasis","205":"Jalo Oasis E","211":"Jarabub Oasis SW","212":"Siwa Oasis W","213":"Siwa Oasis","214":"Siwa Oasis E"} const regions = {"Libya":[7,8,9,10,30,31,32,33,34,35,36,37,38,39,40,54,55,56,57,58,59,60,61,62,63,64,78,79,80,81,82,83,84,85,86,87,88,103,104,105,106,107,108,109,110,111,112,113,128,129,130,131,132,133,134,135,136,137,138,151,152,153,154,155,156,157,158,159,160,161,162,176,177,178,179,180,181,182,183,184,185,186,187,200,201,202,203,204,205,206,207,208,209,210,211],"Egypt":[65,66,67,68,69,70,71,72,73,74,89,90,91,92,93,94,95,96,97,98,114,115,116,117,118,119,120,121,122,123,139,140,141,142,143,144,163,164,165,166,167,188,189,190,191,212,213,214,215],"Sidi Omar":[89],"Tobruk":[37],"Sollum":[65],"El Agheila":[151],"Mersa Brega":[152],"East Line":[36,37,38,39,40,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,85,86,87,88,89,90,91,92,93,94,95,96,97,98,112,113,114,115,116,117,118,119,120,121,122,123,137,138,139,140,141,142,143,144,162,163,164,165,166,167,187,188,189,190,191],"West Line":[7,8,9,10,30,31,32,33,34,35,54,55,56,57,58,59,78,79,80,81,82,83,103,104,105,106,107,128,129,130],"Jebel el Akhdar":[7,8,9,32,33,34,56,57],"Sebkha el Segira":[152,176],"Sebket el Jeneinen":[179,203],"Qattara Depression":[144,145,146,168,169,192,193,216,217]} const units = [{"nationality":"italian","type":"infantry","class":1,"speed":1,"appearance":"S","steps":4,"elite":0,"label":12,"name":"Tre"},{"nationality":"italian","type":"infantry","class":1,"speed":1,"appearance":"S","steps":4,"elite":0,"label":13,"name":"Pav"},{"nationality":"italian","type":"infantry","class":1,"speed":1,"appearance":"S","steps":4,"elite":0,"label":14,"name":"Bre"},{"nationality":"italian","type":"infantry","class":1,"speed":1,"appearance":"S","steps":3,"elite":0,"label":15,"name":"Bol"},{"nationality":"italian","type":"infantry","class":1,"speed":1,"appearance":"S","steps":3,"elite":0,"label":16,"name":"Sav"},{"nationality":"italian","type":"mech. inf.","class":1,"speed":3,"appearance":7,"steps":4,"elite":0,"label":21,"name":"Tri"},{"nationality":"italian","type":"infantry","class":1,"speed":1,"appearance":7,"steps":2,"elite":0,"label":22,"name":"Sab"},{"nationality":"italian","type":"armor","class":0,"speed":3,"appearance":11,"steps":3,"elite":0,"label":23,"name":"Lit"},{"nationality":"italian","type":"mot. inf.","class":1,"speed":2,"appearance":17,"steps":3,"elite":0,"label":24,"name":"Fas"},{"nationality":"italian","type":"mot. inf.","class":1,"speed":2,"appearance":19,"steps":3,"elite":0,"label":25,"name":"Cen"},{"nationality":"italian","type":"infantry","class":1,"speed":1,"appearance":19,"steps":2,"elite":0,"label":26,"name":"Pis"},{"nationality":"italian","type":"para","class":1,"speed":1,"appearance":"M","steps":4,"elite":0,"label":27,"name":"Fol"},{"nationality":"italian","type":"artillery","class":3,"speed":1,"appearance":"S","steps":2,"elite":0,"label":28,"name":"Ita"},{"nationality":"italian","type":"armor","class":0,"speed":3,"appearance":"S","steps":4,"elite":0,"label":29,"name":"Ari"},{"nationality":"german","type":"armor","class":0,"speed":3,"appearance":"S","steps":3,"elite":1,"label":14,"name":"21/5"},{"nationality":"german","type":"recon","class":0,"speed":4,"appearance":"S","steps":1,"elite":1,"label":15,"name":"21/3"},{"nationality":"german","type":"mech. inf.","class":1,"speed":3,"appearance":"S","steps":3,"elite":1,"label":16,"name":"21/104"},{"nationality":"german","type":"recon","class":0,"speed":4,"appearance":3,"steps":1,"elite":1,"label":17,"name":"15/33"},{"nationality":"german","type":"mob. a/t","class":2,"speed":3,"appearance":3,"steps":2,"elite":1,"label":18,"name":"88mm/A"},{"nationality":"german","type":"mech. inf.","class":1,"speed":3,"appearance":3,"steps":3,"elite":1,"label":19,"name":"15/115"},{"nationality":"german","type":"armor","class":0,"speed":3,"appearance":5,"steps":3,"elite":1,"label":21,"name":"15/8"},{"nationality":"german","type":"recon","class":0,"speed":4,"appearance":5,"steps":1,"elite":1,"label":22,"name":"90/580"},{"nationality":"german","type":"mot. inf.","class":1,"speed":2,"appearance":5,"steps":2,"elite":1,"label":23,"name":"90/361"},{"nationality":"german","type":"mot. a/t","class":2,"speed":2,"appearance":5,"steps":2,"elite":1,"label":24,"name":"50mm"},{"nationality":"german","type":"artillery","class":3,"speed":1,"appearance":7,"steps":2,"elite":1,"label":25,"name":"/104"},{"nationality":"german","type":"mot. inf.","class":1,"speed":2,"appearance":7,"steps":2,"elite":1,"label":26,"name":"90/200"},{"nationality":"german","type":"mob. a/t","class":2,"speed":3,"appearance":11,"steps":2,"elite":1,"label":27,"name":"88mm/B"},{"nationality":"german","type":"mech. inf.","class":1,"speed":3,"appearance":11,"steps":2,"elite":1,"label":28,"name":"90/sv288"},{"nationality":"german","type":"mech. inf.","class":1,"speed":3,"appearance":11,"steps":2,"elite":1,"label":29,"name":"90/346"},{"nationality":"german","type":"para","class":1,"speed":1,"appearance":"M","steps":3,"elite":1,"label":31,"name":"Ram"},{"nationality":"german","type":"infantry","class":1,"speed":1,"appearance":"M","steps":3,"elite":1,"label":32,"name":"164/382+433"},{"nationality":"german","type":"infantry","class":1,"speed":1,"appearance":"M","steps":2,"elite":1,"label":33,"name":"164/125"},{"nationality":"german","type":"mech. inf.","class":1,"speed":3,"appearance":3,"steps":3,"elite":1,"label":34,"name":"90/155"},{"nationality":"german","type":"mot. a/t","class":2,"speed":2,"appearance":17,"steps":2,"elite":1,"label":35,"name":"76mm"},{"nationality":"allied","type":"armor","class":0,"speed":3,"appearance":"S","steps":2,"elite":0,"label":14,"name":"2/3"},{"nationality":"allied","type":"mech. inf.","class":1,"speed":3,"appearance":"S","steps":2,"elite":0,"label":15,"name":"2/SG"},{"nationality":"allied","type":"mech. inf.","class":1,"speed":3,"appearance":"S","steps":2,"elite":0,"label":16,"name":"4IN/3m"},{"nationality":"allied","type":"mot. inf.","class":1,"speed":2,"appearance":"S","steps":4,"elite":0,"label":17,"name":"9AU/20"},{"nationality":"allied","type":"mot. inf.","class":1,"speed":2,"appearance":"S","steps":4,"elite":0,"label":18,"name":"70/14+16"},{"nationality":"allied","type":"mot. inf.","class":1,"speed":2,"appearance":"S","steps":3,"elite":0,"label":19,"name":"70/23"},{"nationality":"allied","type":"armor","class":0,"speed":3,"appearance":"T","steps":1,"elite":1,"label":21,"name":"Matilda/A"},{"nationality":"allied","type":"mech. inf.","class":1,"speed":3,"appearance":"T","steps":3,"elite":0,"label":22,"name":"7/SG"},{"nationality":"allied","type":"mech. inf.","class":1,"speed":3,"appearance":"T","steps":3,"elite":0,"label":23,"name":"7/22G"},{"nationality":"allied","type":"mot. inf.","class":1,"speed":2,"appearance":"T","steps":3,"elite":0,"label":24,"name":"/Pol"},{"nationality":"allied","type":"mot. inf.","class":1,"speed":2,"appearance":"T","steps":3,"elite":0,"label":25,"name":"7AU/18"},{"nationality":"allied","type":"artillery","class":3,"speed":1,"appearance":"T","steps":2,"elite":0,"label":26,"name":"/Tob"},{"nationality":"allied","type":"mot. inf.","class":1,"speed":2,"appearance":18,"steps":4,"elite":0,"label":27,"name":"51H/152"},{"nationality":"allied","type":"self prop. arty","class":3,"speed":3,"appearance":18,"steps":2,"elite":0,"label":28,"name":"Priest"},{"nationality":"allied","type":"artillery","class":3,"speed":1,"appearance":18,"steps":4,"elite":0,"label":29,"name":"/C"},{"nationality":"allied","type":"armor","class":0,"speed":3,"appearance":2,"steps":4,"elite":0,"label":31,"name":"7/7"},{"nationality":"allied","type":"mech. inf.","class":1,"speed":3,"appearance":2,"steps":3,"elite":0,"label":32,"name":"4IN/7m"},{"nationality":"allied","type":"mot. inf.","class":1,"speed":2,"appearance":2,"steps":3,"elite":0,"label":33,"name":"4IN/5"},{"nationality":"allied","type":"mot. inf.","class":1,"speed":2,"appearance":2,"steps":3,"elite":0,"label":34,"name":"4IN/11"},{"nationality":"allied","type":"armor","class":0,"speed":3,"appearance":4,"steps":1,"elite":1,"label":35,"name":"Matilda/B"},{"nationality":"allied","type":"i-tank","class":0,"speed":3,"appearance":4,"steps":4,"elite":0,"label":36,"name":"/1AT"},{"nationality":"allied","type":"armor","class":0,"speed":3,"appearance":4,"steps":3,"elite":0,"label":37,"name":"7/4"},{"nationality":"allied","type":"recon","class":0,"speed":4,"appearance":4,"steps":2,"elite":0,"label":38,"name":"7"},{"nationality":"allied","type":"artillery","class":3,"speed":1,"appearance":20,"steps":3,"elite":0,"label":39,"name":"/D"},{"nationality":"allied","type":"mot. a/t","class":2,"speed":2,"appearance":6,"steps":3,"elite":0,"label":41,"name":"2#"},{"nationality":"allied","type":"mech. inf.","class":1,"speed":3,"appearance":6,"steps":4,"elite":0,"label":42,"name":"2NZ/4"},{"nationality":"allied","type":"mech. inf.","class":1,"speed":3,"appearance":6,"steps":4,"elite":0,"label":43,"name":"2NZ/5"},{"nationality":"allied","type":"mech. inf.","class":1,"speed":3,"appearance":6,"steps":4,"elite":0,"label":44,"name":"2NZ/6"},{"nationality":"allied","type":"mot. inf.","class":1,"speed":2,"appearance":6,"steps":4,"elite":0,"label":45,"name":"1SA/2+5"},{"nationality":"allied","type":"mot. inf.","class":1,"speed":2,"appearance":6,"steps":3,"elite":0,"label":46,"name":"1SA/1"},{"nationality":"allied","type":"recon","class":0,"speed":4,"appearance":8,"steps":2,"elite":0,"label":47,"name":"1SA"},{"nationality":"allied","type":"mot. inf.","class":1,"speed":2,"appearance":8,"steps":3,"elite":0,"label":48,"name":"1SA/3"},{"nationality":"allied","type":"mot. inf.","class":1,"speed":2,"appearance":8,"steps":3,"elite":0,"label":49,"name":"2SA/4+6"},{"nationality":"allied","type":"armor","class":0,"speed":3,"appearance":8,"steps":4,"elite":0,"label":51,"name":"1/22"},{"nationality":"allied","type":"i-tank","class":0,"speed":3,"appearance":8,"steps":3,"elite":0,"label":52,"name":"/32AT"},{"nationality":"allied","type":"artillery","class":3,"speed":1,"appearance":8,"steps":2,"elite":0,"label":53,"name":"/A"},{"nationality":"allied","type":"armor","class":0,"speed":3,"appearance":10,"steps":4,"elite":0,"label":54,"name":"1/2"},{"nationality":"allied","type":"mech. inf.","class":1,"speed":3,"appearance":10,"steps":3,"elite":0,"label":55,"name":"1/201G"},{"nationality":"allied","type":"mech. inf.","class":1,"speed":3,"appearance":10,"steps":2,"elite":0,"label":56,"name":"1/SG"},{"nationality":"allied","type":"mot. inf.","class":1,"speed":2,"appearance":10,"steps":3,"elite":0,"label":57,"name":"5IN/29"},{"nationality":"allied","type":"armor","class":0,"speed":3,"appearance":12,"steps":2,"elite":1,"label":58,"name":"Grant"},{"nationality":"allied","type":"mot. a/t","class":2,"speed":2,"appearance":12,"steps":3,"elite":0,"label":59,"name":"6#/A"},{"nationality":"allied","type":"mech. inf.","class":1,"speed":3,"appearance":14,"steps":2,"elite":0,"label":61,"name":"10IN/161m"},{"nationality":"allied","type":"mot. inf.","class":1,"speed":2,"appearance":14,"steps":4,"elite":0,"label":62,"name":"5IN/9+10"},{"nationality":"allied","type":"mot. inf.","class":1,"speed":2,"appearance":14,"steps":4,"elite":0,"label":63,"name":"10IN/21+25"},{"nationality":"allied","type":"mot. inf.","class":1,"speed":2,"appearance":14,"steps":2,"elite":0,"label":64,"name":"8IN/18"},{"nationality":"allied","type":"mot. inf.","class":1,"speed":2,"appearance":14,"steps":4,"elite":0,"label":65,"name":"FF/2"},{"nationality":"allied","type":"artillery","class":3,"speed":1,"appearance":14,"steps":4,"elite":0,"label":66,"name":"/B"},{"nationality":"allied","type":"armor","class":0,"speed":3,"appearance":20,"steps":3,"elite":1,"label":67,"name":"Sher/B"},{"nationality":"allied","type":"armor","class":0,"speed":3,"appearance":20,"steps":3,"elite":0,"label":68,"name":"8/9"},{"nationality":"allied","type":"armor","class":0,"speed":3,"appearance":20,"steps":3,"elite":0,"label":69,"name":"8/24"},{"nationality":"allied","type":"armor","class":0,"speed":3,"appearance":16,"steps":4,"elite":0,"label":71,"name":"10/8"},{"nationality":"allied","type":"armor","class":0,"speed":3,"appearance":16,"steps":3,"elite":0,"label":72,"name":"10/23"},{"nationality":"allied","type":"mot. inf.","class":1,"speed":2,"appearance":16,"steps":4,"elite":0,"label":73,"name":"9AU/26"},{"nationality":"allied","type":"mot. inf.","class":1,"speed":2,"appearance":16,"steps":4,"elite":0,"label":74,"name":"9AU/24"},{"nationality":"allied","type":"mot. inf.","class":1,"speed":2,"appearance":16,"steps":4,"elite":0,"label":75,"name":"44/131+133"},{"nationality":"allied","type":"mot. inf.","class":1,"speed":2,"appearance":16,"steps":2,"elite":0,"label":76,"name":"44/132"},{"nationality":"allied","type":"armor","class":0,"speed":3,"appearance":18,"steps":3,"elite":1,"label":77,"name":"Sher/A"},{"nationality":"allied","type":"mot. a/t","class":2,"speed":2,"appearance":18,"steps":4,"elite":0,"label":78,"name":"6#/B"},{"nationality":"allied","type":"mot. inf.","class":1,"speed":2,"appearance":18,"steps":4,"elite":0,"label":79,"name":"51H/154"}] if (typeof module !== 'undefined') module.exports = { all_hexes, hex_exists, hex_name, hex_road, side_road, side_limit, regions, units } diff --git a/play.js b/play.js index 663d903..78e1b3a 100644 --- a/play.js +++ b/play.js @@ -10,6 +10,9 @@ const sqrt = Math.sqrt const class_name = [ "armor", "infantry", "anti-tank", "artillery" ] +// refit and queue hexes +const hex_special = [ 48, 49, 102, 127 ] + const ARMOR = 0 const INFANTRY = 1 const ANTITANK = 2 @@ -425,7 +428,7 @@ function build_hexes() { ui.hex_y[hex_id] = round(hex_y) // Add hex cell - if (hex_exists[hex_id]) + if (hex_exists[hex_id] || hex_special.includes(hex_id)) { let hex = ui.hexes[hex_id] = document.createElementNS(svgNS, "polygon") hex.setAttribute("class", "hex") diff --git a/rules.js b/rules.js index 886ae3a..52a0354 100644 --- a/rules.js +++ b/rules.js @@ -3,13 +3,18 @@ // TODO: fortress supply // TODO: oasis supply // TODO: raiders -// TODO: reveal minefields +// TODO: minefields // TODO: gazala scenario // TODO: legal pass withdrawal moves (reduce supply net, withdraw from fortress attack) // TOOD: reveal/hide blocks (hexes) // TODO: malta units? +// TODO: group move from queue holding box to base -// TODO: BUILDUP +// TODO: redeployment +// TODO: return for refit +// TODO: replacements + +// RULES: may units redeploying out of battles cross enemy controlled hexsides? // RULES: when is "fired" status cleared? @@ -95,6 +100,14 @@ const FIREPOWER_MATRIX = [ [ SF, DF, DF, SF ], ] +// Off board return to refit holding +const AXIS_REFIT = 102 +const ALLIED_REFIT = 48 + +// Off board reinforcements to engaged base! +const AXIS_QUEUE = 127 +const ALLIED_QUEUE = 49 + const EL_AGHEILA = 151 const ALEXANDRIA = 74 const BENGHAZI = 54 @@ -480,6 +493,18 @@ function friendly_base() { return ALEXANDRIA } +function friendly_queue() { + if (is_axis_player()) + return AXIS_QUEUE + return ALLIED_QUEUE +} + +function friendly_refit() { + if (is_axis_player()) + return AXIS_REFIT + return ALLIED_REFIT +} + function update_presence() { presence_invalid = false presence_axis.fill(0) @@ -3786,15 +3811,18 @@ function goto_buildup_supply_check() { // Remember supply networks throughout buildup. game.buildup = { + // redeployment network axis_network: axis_supply_network().slice(), allied_network: allied_supply_network().slice(), + // extra cards purchased axis_cards: 0, allied_cards: 0, + // remaining port capacity for sea redeployment + bardia: 2, + benghazi: 2, + tobruk: 5, } - debug_hexes("axis supply", supply_axis_network) - debug_hexes("allied supply", supply_allied_network) - for_each_axis_unit_on_map(u => { let x = unit_hex(u) if (supply_axis_network[x]) @@ -3900,9 +3928,18 @@ states.buildup_reinforcements = { function apply_reinforcements() { let base = friendly_base() + let refitted = 0 let scheduled = 0 let early = 0 + if (is_battle_hex(base)) + base = friendly_queue() + + for_each_friendly_unit_in_hex(friendly_refit(), u => { + set_unit_hex(u, base) + refitted++ + }) + for_each_friendly_unit_in_month(game.month, u => { set_unit_hex(u, base) scheduled++ @@ -3918,6 +3955,8 @@ function apply_reinforcements() { } log(`Reinforcements at #${base}:`) + if (refitted > 0) + log(`>${refitted} refitted`) log(`>${scheduled} on schedule`) log(`>${early} early`) } @@ -3963,6 +4002,7 @@ function end_buildup_spending() { set_enemy_player() goto_buildup_reinforcements() } else { + delete game.buildup goto_buildup_resupply() } } @@ -4060,7 +4100,7 @@ states.axis_player_initiative = { // === VICTORY CHECK === const EXIT_EAST_EDGE = [ 99, 123, 148 ] //, 172, 197 ] -const EXIT_EAST_STASH = 49 +const EXIT_EAST = 172 function check_sudden_death_victory() { // Supplied units that move beyond the map "edge" exit the map. @@ -4070,14 +4110,14 @@ function check_sudden_death_victory() { for_each_axis_unit(u => { if (unit_hex(u) === x && is_unit_supplied(u)) { log(`Exited the east map edge.`) - set_unit_hex(u, EXIT_EAST_STASH) + set_unit_hex(u, EXIT_EAST) } }) } let axis_exited = 0 for_each_axis_unit(u => { - if (unit_hex(u) === EXIT_EAST_STASH) + if (unit_hex(u) === EXIT_EAST) axis_exited++ }) diff --git a/tools/gendata.js b/tools/gendata.js index 2db503d..cf77791 100644 --- a/tools/gendata.js +++ b/tools/gendata.js @@ -398,8 +398,12 @@ hex_name = { 172: "Map Edge", 197: "Map Edge", 147: "El Himeimat E SE", // TODO -} + 48: "Alexandria Refit", + 49: "Alexandria Queue", + 102: "El Agheila Refit", + 127: "El Agheila Queue", +} function expand_names() { let hex_name2 = { } -- cgit v1.2.3