You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var o,challenge,boarding_odds,boarding_difficulty,boarding_advantage,boarding_disadvantage,gear_bonus,marine_bonus,outcome_roll,damage_roll,attack,arp,wep,ac,dr,co,i,hits,hurt,damaged_ship,bridge_damage;
for (var o=0;o<array_length(origin.board_co);o++){
@@ -79,38 +79,61 @@ if (boarding=true) and (board_cooldown>=0) and (instance_exists(target)) and (in
79
79
80
80
co=origin.board_co[o];
81
81
i=origin.board_id[o];
82
-
difficulty=50;
83
82
ac=0;
84
83
dr=1;
85
84
unit=fetch_unit([co,i]);
85
+
gear_bonus=0;
86
+
marine_bonus=0;
87
+
boarding_odds=50;
88
+
boarding_advantage=0;
89
+
boarding_disadvantage=0;
86
90
if (unit.hp()>0){
87
91
88
92
// Bonuses
89
-
difficulty+=unit.experience/20;
90
-
difficulty+=(1-(target.hp/target.maxhp))*33;
91
-
//TODO define tag for bording weapons
92
-
if (array_contains(["Chainfist","Meltagun","Lascutter","Boarding Shield"], unit.weapon_one())) then difficulty+=3;
93
-
if (array_contains(["Chainfist","Meltagun","Lascutter","Boarding Shield"], unit.weapon_two())) then difficulty+=3;
93
+
marine_bonus+=unit.experience/20;
94
+
marine_bonus+=(1-(target.hp/target.maxhp))*33; // if wounded marine will perform worse
94
95
95
-
if (scr_has_adv("Boarders")) then difficulty+=7;
96
-
if (scr_has_adv("Assault Doctrine")) then difficulty+=3;
97
-
if (scr_has_adv("Lightning Warriors")) then difficulty+=3;
96
+
var _weapons = [unit.get_weapon_one_data(), unit.get_weapon_two_data()];
97
+
if (_weapons[0] == "" && _weapons[1] == "") {
98
+
gear_bonus -= 10;
99
+
} else {
100
+
for (var i = 0; i <= 1; i++) {
101
+
var _weapon = _weapons[i];
102
+
if (!is_struct(_weapon)) then break
103
+
104
+
if (_weapon.has_tag("boarding 1")) {
105
+
gear_bonus += 2;
106
+
bridge_damage = max(bridge_damage, 3);
107
+
} elseif (_weapon.has_tag("boarding 2")) {
108
+
gear_bonus += 4;
109
+
bridge_damage = max(bridge_damage, 5);
110
+
} elseif (_weapon.has_tag("boarding 3")) {
111
+
gear_bonus += 6;
112
+
bridge_damage = max(bridge_damage, 7);
113
+
}
114
+
}
115
+
}
116
+
if (scr_has_adv("Boarders")) then marine_bonus+=7;
117
+
if (scr_has_adv("Assault Doctrine")) then marine_bonus+=3;
118
+
if (scr_has_adv("Lightning Warriors")) then marine_bonus+=3;
119
+
120
+
boarding_advantage+=(gear_bonus+marine_bonus)
98
121
99
122
// Penalties
100
-
if (unit.weapon_one()=="")then difficulty-=10;
101
-
if (unit.weapon_two()=="")then difficulty-=10;
102
123
if (unit.base_group == "astartes"){
103
-
if (unit.gene_seed_mutations.occulobe==1) then difficulty-=5;
124
+
if (unit.gene_seed_mutations.occulobe==1) then boarding_disadvantage-=5;
104
125
}
105
-
if (target.owner = eFACTION.Imperium) or ((target.owner = eFACTION.Chaos) and (obj_fleet.csm_exp=0)) then difficulty-=0;// Cultists/Pirates/Humans
106
-
if (target.owner = eFACTION.Player) or (target.owner = eFACTION.Ecclesiarchy) or (target.owner = eFACTION.Ork) or (target.owner = eFACTION.Eldar) or (target.owner = eFACTION.Necrons) then difficulty-=10;
107
-
if (target.owner = eFACTION.Chaos) and (obj_fleet.csm_exp=1) then difficulty-=20;// Veteran marines
108
-
if ((target.owner = eFACTION.Chaos) and (obj_fleet.csm_exp=2)) or (target.owner = eFACTION.Tyranids) then difficulty-=30;// Daemons, veteran CSM, tyranids
109
-
110
-
roll1=floor(random(100))+1;
126
+
if (target.owner = eFACTION.Imperium) or ((target.owner = eFACTION.Chaos) and (obj_fleet.csm_exp=0)) then boarding_disadvantage-=0;// Cultists/Pirates/Humans
127
+
if (target.owner = eFACTION.Player) or (target.owner = eFACTION.Ecclesiarchy) or (target.owner = eFACTION.Ork) or (target.owner = eFACTION.Eldar) or (target.owner = eFACTION.Necrons) then boarding_disadvantage-=10;
128
+
if (target.owner = eFACTION.Chaos) and (obj_fleet.csm_exp=1) then boarding_disadvantage-=20;// Veteran marines
129
+
if ((target.owner = eFACTION.Chaos) and (obj_fleet.csm_exp=2)) or (target.owner = eFACTION.Tyranids) then boarding_disadvantage-=30;// Daemons, veteran CSM, tyranids
0 commit comments