1-
21function scr_move_unit_info (start_company,end_company, start_slot, end_slot, eval_squad=true ){
32
4- // eval_squad : determine whether movement of units between companies should decide to check their squad coherency or not, defaults to true
5-
6- // this makes sure coherency of the unit's squad and the squads logging of the unit location are kept up to date
7- var unit = obj_ini.TTRPG [start_company, start_slot];
8- if (eval_squad){
9- unit.movement_after_math (end_company,end_slot);
10- }
11- obj_ini.spe [end_company][end_slot]=obj_ini.spe [start_company][start_slot];
12- obj_ini.race [end_company][end_slot]=obj_ini.race [start_company][start_slot];
13- obj_ini.loc [end_company][end_slot]=obj_ini.loc [start_company][start_slot];
14- obj_ini.name [end_company][end_slot]=obj_ini.name [start_company][start_slot];
15- obj_ini.wep1 [end_company][end_slot]=obj_ini.wep1 [start_company][start_slot];
16- obj_ini.role [end_company][end_slot]=obj_ini.role [start_company][start_slot];
17- obj_ini.wep2 [end_company][end_slot]=obj_ini.wep2 [start_company][start_slot];
18- obj_ini.gear [end_company][end_slot]=obj_ini.gear [start_company][start_slot];
19- obj_ini.armour [end_company][end_slot]=obj_ini.armour [start_company][start_slot];
20- obj_ini.god [end_company][end_slot]=obj_ini.god [start_company][start_slot];
21- obj_ini.age [end_company][end_slot]=obj_ini.age [start_company][start_slot];
22- obj_ini.mobi [end_company][end_slot]=obj_ini.mobi [start_company][start_slot];
23- var temp_struct = jsonify_marine_struct (start_company,start_slot); // jsonified for stransfer of struct (makes a deep copy)
24- obj_ini.TTRPG [end_company][end_slot] = new TTRPG_stats (" chapter" , end_company,end_slot ," blank" ); // create new empty unit structure
25- if (is_string (temp_struct)){
26- obj_ini.TTRPG [end_company][end_slot].load_json_data (json_parse (temp_struct)); // load in originoal marine data
27- obj_ini.TTRPG [end_company][end_slot].company = end_company;
28- obj_ini.TTRPG [end_company][end_slot].marine_number = end_slot;
29- } else {
30- obj_ini.TTRPG [end_company][end_slot] = new TTRPG_stats (" chapter" , end_company,end_slot ," blank" );
31- }
3+ // eval_squad : determine whether movement of units between companies should decide to check their squad coherency or not, defaults to true
4+
5+ // this makes sure coherency of the unit's squad and the squads logging of the unit location are kept up to date
6+ var unit = obj_ini.TTRPG [start_company, start_slot];
7+ if (eval_squad){
8+ unit.movement_after_math (end_company,end_slot);
9+ }
10+ obj_ini.spe [end_company][end_slot]=obj_ini.spe [start_company][start_slot];
11+ obj_ini.race [end_company][end_slot]=obj_ini.race [start_company][start_slot];
12+ obj_ini.loc [end_company][end_slot]=obj_ini.loc [start_company][start_slot];
13+ obj_ini.name [end_company][end_slot]=obj_ini.name [start_company][start_slot];
14+ obj_ini.wep1 [end_company][end_slot]=obj_ini.wep1 [start_company][start_slot];
15+ obj_ini.role [end_company][end_slot]=obj_ini.role [start_company][start_slot];
16+ obj_ini.wep2 [end_company][end_slot]=obj_ini.wep2 [start_company][start_slot];
17+ obj_ini.gear [end_company][end_slot]=obj_ini.gear [start_company][start_slot];
18+ obj_ini.armour [end_company][end_slot]=obj_ini.armour [start_company][start_slot];
19+ obj_ini.god [end_company][end_slot]=obj_ini.god [start_company][start_slot];
20+ obj_ini.age [end_company][end_slot]=obj_ini.age [start_company][start_slot];
21+ obj_ini.mobi [end_company][end_slot]=obj_ini.mobi [start_company][start_slot];
22+ obj_ini.TTRPG [end_company][end_slot] = new TTRPG_stats (" chapter" , end_company, end_slot, " blank" ); // create new empty unit structure
23+ obj_ini.TTRPG [end_company][end_slot] = obj_ini.TTRPG [start_company][start_slot]; // load in originoal marine data
24+ obj_ini.TTRPG [end_company][end_slot].company = end_company;
25+ obj_ini.TTRPG [end_company][end_slot].marine_number = end_slot;
3226
33- scr_wipe_unit (start_company,start_slot);
34- }
27+ scr_wipe_unit (start_company,start_slot);
28+ }
0 commit comments