Skip to content

feat: Combat adjustments #352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ad3b9fd
Weapon Value adj
KRdaMystic Nov 2, 2024
72bd4ce
Vehicle weapons
KRdaMystic Nov 10, 2024
bf37f58
changes
KRdaMystic Nov 29, 2024
4845d99
Apply suggestions from code review
EttyKitty Dec 1, 2024
0a34029
AP to 0 on the leftover heavy bolters
EttyKitty Dec 1, 2024
ddb6b1a
feat: Boarding tags (#232)
KRdaMystic Dec 24, 2024
d2760a9
chore: Adjustments to weapon balance (#219)
KRdaMystic Dec 24, 2024
6e8af19
feat: New weapon tags for custom stat scaling (#192)
KRdaMystic Dec 28, 2024
8591580
Merge branch 'release/0.10.0.0' into WeapAdj2
KRdaMystic Dec 29, 2024
c7e5d8d
Update objects/obj_p_assra/Step_0.gml
KRdaMystic Dec 29, 2024
78edd89
Update objects/obj_p_assra/Step_0.gml
KRdaMystic Dec 30, 2024
e988342
Merge branch 'release/0.10.0.0' into WeapAdj2
KRdaMystic Dec 30, 2024
06e72a5
refactor: Adjust weapon "arp" values
KRdaMystic Dec 30, 2024
ce5e613
refactor: Adjust weapon "arp" values
KRdaMystic Dec 30, 2024
9da0741
Merge remote-tracking branch 'origin/WeapAdj2' into WeapAdj2
KRdaMystic Dec 30, 2024
36501d6
arp change seperation
KRdaMystic Jan 2, 2025
774a2fc
feat: AP formula Changes finalized
KRdaMystic Jan 2, 2025
0a19bba
Merge branch 'WeapAdj2' into feat/new_ap_system
KRdaMystic Jan 13, 2025
e8160c9
Merge remote-tracking branch 'Adeptus-Dominus/main' into feat/new_ap_…
KRdaMystic Jan 13, 2025
92bec48
fix typo
KRdaMystic Jan 13, 2025
df2a03c
fix typo
KRdaMystic Jan 13, 2025
fd96c61
Merge remote-tracking branch 'origin/WeapAdj2' into WeapAdj2
KRdaMystic Jan 13, 2025
244528c
Merge branch 'main' into WeapAdj2
KRdaMystic Jan 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
174 changes: 85 additions & 89 deletions objects/obj_p_assra/Step_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ if (boarding=true) and (board_cooldown>=0) and (instance_exists(target)) and (in
board_cooldown-=1;

if (board_cooldown=0){board_cooldown=60;
var o,challenge,difficulty,roll1,roll2,attack,arp,wep,ac,dr,co,i,hits,hurt,damaged_ship;
o=firstest-1;difficulty=50;challenge=0;roll1=0;roll2=0;attack=0;arp=0;wep="";hits=0;hurt=0;damaged_ship=0;
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;
o=firstest-1;boarding_odds=0;challenge=0;outcome_roll=0;damage_roll=0;attack=0;arp=0;wep="";hits=0;hurt=0;damaged_ship=0,bridge_damage=1;
co=0;i=0;ac=0;dr=1;

for (var o=0;o<array_length(origin.board_co);o++){
Expand All @@ -79,38 +79,61 @@ if (boarding=true) and (board_cooldown>=0) and (instance_exists(target)) and (in

co=origin.board_co[o];
i=origin.board_id[o];
difficulty=50;
ac=0;
dr=1;
unit=fetch_unit([co,i]);
gear_bonus=0;
marine_bonus=0;
boarding_odds=50;
boarding_advantage=0;
boarding_disadvantage=0;
if (unit.hp()>0){

// Bonuses
difficulty+=unit.experience/20;
difficulty+=(1-(target.hp/target.maxhp))*33;
//TODO define tag for bording weapons
if (array_contains(["Chainfist","Meltagun","Lascutter","Boarding Shield"], unit.weapon_one())) then difficulty+=3;
if (array_contains(["Chainfist","Meltagun","Lascutter","Boarding Shield"], unit.weapon_two())) then difficulty+=3;
marine_bonus+=unit.experience/20;
marine_bonus+=(1-(target.hp/target.maxhp))*33; // if wounded marine will perform worse

if (scr_has_adv("Boarders")) then difficulty+=7;
if (scr_has_adv("Assault Doctrine")) then difficulty+=3;
if (scr_has_adv("Lightning Warriors")) then difficulty+=3;
var _weapons = [gear_weapon_data("weapon", unit.weapon_one()), gear_weapon_data("weapon", unit.weapon_two())];
if (_weapons[0] == "" && _weapons[1] == "") {
gear_bonus -= 10;
} else {
for (var i = 0; i <= 1; i++) {
var _weapon = _weapons[i];
if (!is_struct(_weapon)) then break

if (_weapon.has_tag("boarding 1")) {
gear_bonus += 2;
bridge_damage = max(bridge_damage, 3);
} else if (_weapon.has_tag("boarding 2")) {
gear_bonus += 4;
bridge_damage = max(bridge_damage, 5);
} else if (_weapon.has_tag("boarding 3")) {
gear_bonus += 6;
bridge_damage = max(bridge_damage, 7);
}
}
}
if (scr_has_adv("Boarders")) then marine_bonus+=7;
if (scr_has_adv("Assault Doctrine")) then marine_bonus+=3;
if (scr_has_adv("Lightning Warriors")) then marine_bonus+=3;

boarding_advantage+=(gear_bonus+marine_bonus)

// Penalties
if (unit.weapon_one()=="")then difficulty-=10;
if (unit.weapon_two()=="")then difficulty-=10;
if (unit.base_group == "astartes"){
if (unit.gene_seed_mutations.occulobe==1) then difficulty-=5;
if (unit.gene_seed_mutations.occulobe==1) then boarding_disadvantage-=5;
}
if (target.owner = eFACTION.Imperium) or ((target.owner = eFACTION.Chaos) and (obj_fleet.csm_exp=0)) then difficulty-=0;// Cultists/Pirates/Humans
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;
if (target.owner = eFACTION.Chaos) and (obj_fleet.csm_exp=1) then difficulty-=20;// Veteran marines
if ((target.owner = eFACTION.Chaos) and (obj_fleet.csm_exp=2)) or (target.owner = eFACTION.Tyranids) then difficulty-=30;// Daemons, veteran CSM, tyranids

roll1=floor(random(100))+1;
if (target.owner = eFACTION.Imperium) or ((target.owner = eFACTION.Chaos) and (obj_fleet.csm_exp=0)) then boarding_disadvantage-=0;// Cultists/Pirates/Humans
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;
if (target.owner = eFACTION.Chaos) and (obj_fleet.csm_exp=1) then boarding_disadvantage-=20;// Veteran marines
if ((target.owner = eFACTION.Chaos) and (obj_fleet.csm_exp=2)) or (target.owner = eFACTION.Tyranids) then boarding_disadvantage-=30;// Daemons, veteran CSM, tyranids

boarding_odds+=boarding_advantage+boarding_disadvantage;
boarding_odds=clamp(boarding_odds,0,100);
outcome_roll=floor(random(100))+1;


if (roll1<=difficulty){// Success
if (outcome_roll<=boarding_odds){// Success
if (damage=true) and (steal=false){// Damaging
var to_bomb;to_bomb=false;
if (plasma_bomb=true) and (obj_ini.gear[co][i]="Plasma Bomb") then to_bomb=true;
Expand All @@ -124,39 +147,12 @@ if (boarding=true) and (board_cooldown>=0) and (instance_exists(target)) and (in
obj_ini.gear[co][i]="";
}
}

if (steal=true) and (damage=false){// Stealing
var bridge_damage=0;
damaged_ship=max(1,damaged_ship);

var we,whi,we1,we2;we="";
we1=unit.weapon_one();
we2=unit.weapon_two();
whi=0;

bridge_damage=3;
//TODO tagging system to slove this
we="Heavy Thunder Hammer";
if (we1=we) or (we2=we) then bridge_damage=max(bridge_damage,8);
we="Eviscerator";
if (we1=we) or (we2=we) then bridge_damage=max(bridge_damage,7);
we="Chainfist";
if (we1=we) or (we2=we) then bridge_damage=max(bridge_damage,7);
we="Lascutter";
if (we1=we) or (we2=we) then bridge_damage=max(bridge_damage,7);
we="Meltagun";
if (we1=we) or (we2=we) then bridge_damage=max(bridge_damage,7);
we="Power Fist";
if (we1=we) or (we2=we) then bridge_damage=max(bridge_damage,6);
we="Thunder Hammer";
if (we1=we) or (we2=we) then bridge_damage=max(bridge_damage,6);
we="Plasma Gun";
if (we1=we) or (we2=we) then bridge_damage=max(bridge_damage,5);
we="Relic Blade";
if (we1=we) or (we2=we) then bridge_damage=max(bridge_damage,4);
if (string_pos("&",string(obj_ini.wep1[co][i])+string(obj_ini.wep2[co][i]))>0) then bridge_damage=9;

target.bridge-=bridge_damage;
}

if ((target.hp<=0) or (target.bridge<=0)){
var husk=instance_create(target.x,target.y,obj_en_husk);

Expand Down Expand Up @@ -196,67 +192,67 @@ if (boarding=true) and (board_cooldown>=0) and (instance_exists(target)) and (in
}


if (roll1>difficulty){// FAILURE
if (outcome_roll>boarding_odds){// FAILURE

ac=unit.armour_calc()
dr = unit.damage_resistance()/100

roll2=floor(random(100))+1;
damage_roll=floor(random(100))+1;

//TODO streamline enemy weapons
if (target.owner = eFACTION.Imperium) or (target.owner = eFACTION.Chaos) or (target.owner = eFACTION.Ecclesiarchy){
// Make worse for CSM
wep="Lasgun";
hits=1;
if (roll2<=90) then hits=2;
if (roll2<=75) then hits=3;
if (roll2<=50){wep="Bolt Pistol";hits=1;}
if (roll2<=40){wep="Bolter";hits=1;}
if (roll2<=30){wep="Bolter";hits=2;}
if (roll2<=20){wep="Heavy Bolter";hits=1;}
if (roll2<=10){wep="Plasma Pistol";hits=1;}
if (roll2<=5){wep="Meltagun";hits=1;}
if (damage_roll<=90) then hits=2;
if (damage_roll<=75) then hits=3;
if (damage_roll<=50){wep="Bolt Pistol";hits=1;}
if (damage_roll<=40){wep="Bolter";hits=1;}
if (damage_roll<=30){wep="Bolter";hits=2;}
if (damage_roll<=20){wep="Heavy Bolter";hits=1;}
if (damage_roll<=10){wep="Plasma Pistol";hits=1;}
if (damage_roll<=5){wep="Meltagun";hits=1;}
}
if (target.owner = eFACTION.Eldar){
wep="Shuriken Pistol";hits=1;
if (roll2<=90) then hits=2;
if (roll2<=75) then hits=3;
if (roll2<=60){wep="Shuriken Catapult";hits=2;}
if (roll2<=50){wep="Shuriken Catapult";hits=3;}
if (roll2<=40){wep="Shuriken Catapult";hits=4;}
if (roll2<=30){wep="Wraith Cannon";hits=1;}
if (roll2<=20){wep="Singing Spear";hits=1;}
if (roll2<=10){wep="Meltagun";hits=1;}
if (damage_roll<=90) then hits=2;
if (damage_roll<=75) then hits=3;
if (damage_roll<=60){wep="Shuriken Catapult";hits=2;}
if (damage_roll<=50){wep="Shuriken Catapult";hits=3;}
if (damage_roll<=40){wep="Shuriken Catapult";hits=4;}
if (damage_roll<=30){wep="Wraith Cannon";hits=1;}
if (damage_roll<=20){wep="Singing Spear";hits=1;}
if (damage_roll<=10){wep="Meltagun";hits=1;}
}
if (target.owner = eFACTION.Ork){
wep="Shoota";hits=1;
if (roll2<=90) then hits=2;
if (roll2<=75) then hits=3;
if (roll2<=60) then hits=4;
if (roll2<=50){wep="Dakkagun";hits=1;}
if (roll2<=40){wep="Big Shoota";hits=1;}
if (roll2<=30){wep="Big Shoota";hits=2;}
if (roll2<=15){wep="Rokkit";hits=1;}
if (damage_roll<=90) then hits=2;
if (damage_roll<=75) then hits=3;
if (damage_roll<=60) then hits=4;
if (damage_roll<=50){wep="Dakkagun";hits=1;}
if (damage_roll<=40){wep="Big Shoota";hits=1;}
if (damage_roll<=30){wep="Big Shoota";hits=2;}
if (damage_roll<=15){wep="Rokkit";hits=1;}
}
if (target.owner = eFACTION.Tau){
wep="Pulse Rifle";hits=1;
if (roll2<=80) then hits=2;
if (roll2<=65) then hits=3;
if (roll2<=50) then hits=4;
if (roll2<=40){wep="Missile Pod";hits=1;}
if (roll2<=30){wep="Burst Rifle";hits=1;}
if (roll2<=15){wep="Meltagun";hits=1;}
if (damage_roll<=80) then hits=2;
if (damage_roll<=65) then hits=3;
if (damage_roll<=50) then hits=4;
if (damage_roll<=40){wep="Missile Pod";hits=1;}
if (damage_roll<=30){wep="Burst Rifle";hits=1;}
if (damage_roll<=15){wep="Meltagun";hits=1;}
}
if (target.owner = eFACTION.Tyranids){
wep="Flesh Hooks";hits=1;
if (roll2<=90) then hits=2;
if (roll2<=75) then hits=3;
if (roll2<=60){wep="Devourer";hits=2;}
if (roll2<=50){wep="Devourer";hits=3;}
if (roll2<=40){wep="Devourer";hits=4;}
if (roll2<=30){wep="Venom Cannon";hits=1;}
if (roll2<=20){wep="Lictor Claws";hits=1;}
if (roll2<=10){wep="Zoanthrope Blast";hits=1;}
if (damage_roll<=90) then hits=2;
if (damage_roll<=75) then hits=3;
if (damage_roll<=60){wep="Devourer";hits=2;}
if (damage_roll<=50){wep="Devourer";hits=3;}
if (damage_roll<=40){wep="Devourer";hits=4;}
if (damage_roll<=30){wep="Venom Cannon";hits=1;}
if (damage_roll<=20){wep="Lictor Claws";hits=1;}
if (damage_roll<=10){wep="Zoanthrope Blast";hits=1;}
}

if (wep="Lasgun"){attack=25;arp=0;}
Expand Down
Loading
Loading