Skip to content
Merged
Changes from all commits
Commits
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
88 changes: 56 additions & 32 deletions scripts/scr_powers/scr_powers.gml
Original file line number Diff line number Diff line change
Expand Up @@ -559,57 +559,81 @@ function scr_powers(power_set, power_count, enemy_target, unit_id) {
if (obj_ncombat.sorcery_seen=1) then obj_ncombat.sorcery_seen=2;

if (p_type="buff") or (power_name="gather_energy"){
var marine_index;
var _random_marine_list = [];
for (var i=0;i<array_length(unit_struct);i++){
array_push(_random_marine_list, i);
}
_random_marine_list = array_shuffle(_random_marine_list);

if (power_name="Force Dome") or (power_name="Stormbringer"){
var buf,h;buf=9;h=0;
repeat(100){
if (buf>0){h=floor(random(men))+1;if (marine_type[h]!="") and (marine_dead[h]=0) and (marine_mshield[h]=0){buf-=1;marine_mshield[h]=2;}}
if (buf=0){
if (marine_mshield[unit_id]<2){
buf-=1;marine_mshield[unit_id]=2;
}}
var buf=9;
for (var i=0;i<array_length(_random_marine_list);i++){
if (buf<=0) then break;
marine_index = _random_marine_list[i];
if (!marine_dead[marine_index]) and (!marine_mshield[marine_index]){
buf-=1;
marine_mshield[marine_index]=2;
}
}
}
if (power_name="Quickening"){if (marine_quick[unit_id]<3) then marine_quick[unit_id]=3;}

if (power_name="Quickening"){
if (marine_quick[unit_id]<3) then marine_quick[unit_id]=3;
}
if (power_name="Might of the Ancients"){if (marine_might[unit_id]<3) then marine_might[unit_id]=3;}

if (power_name="Fiery Form"){if (marine_fiery[unit_id]<3) then marine_fiery[unit_id]=3;}
if (power_name="Fire Shield"){
var buf,h;buf=9;h=0;
repeat(100){
if (buf>0){
h=irandom(men-1)+1;
if (marine_type[h]!="") and (marine_dead[h]=0) and (marine_fshield[h]=0){
buf-=1;
marine_fshield[h]=2;
}
}
if (buf=0){
if (marine_fshield[unit_id]<2){
buf-=1;marine_fshield[unit_id]=2;
}
}
}
var buf=9;
for (var i=0;i<array_length(_random_marine_list);i++){
if (buf<=0) then break;
marine_index = _random_marine_list[i];
if (!marine_dead[marine_index]) and (!marine_fshield[marine_index]){
buf-=1;
marine_fshield[marine_index]=2;
}
}
}

if (power_name="Iron Arm") then marine_iron[unit_id]+=1;
if (power_name="Endurance"){
var buf,h;buf=5;h=0;
repeat(100){
if (buf>0){h=floor(random(men))+1;if (marine_type[h]!="") and (marine_hp[h]<=80) and (marine_dead[h]=0){buf-=1;marine_hp[h]+=20;if (marine_hp[h]>100) then marine_hp[h]=100;}}
}

var buf=5;h=0;
for (var i=0;i<array_length(_random_marine_list);i++){
if (buf<=0) then break;
marine_index = _random_marine_list[i];
if (!marine_dead[marine_index]){
var _buff_unit = unit_struct[marine_index];
if (_buff_unit.hp()<_buff_unit.max_health()){
buf-=1;
_buff_unit.add_or_sub_health(20);
}
}
}
}
if (power_name="Hysterical Frenzy"){
var buf,h;buf=5;h=0;
repeat(100){
if (buf>0){h=floor(random(men))+1;if (marine_type[h]!="") and (marine_attack[h]<2.5) and (marine_dead[h]=0){buf-=1;marine_attack[h]+=1.5;marine_defense[h]-=0.15;}}
var buf=5;h=0;
for (var i=0;i<array_length(_random_marine_list);i++){
if (buf<=0) then break;
marine_index = _random_marine_list[i];
if (!marine_dead[marine_index]) and (marine_attack[marine_index]<2.5){
buf-=1;
marine_attack[marine_index]+=1.5;
marine_defense[marine_index]-=0.15;
}
}
}
if (power_name="Regenerate"){
unit.add_or_sub_health(choose(2,3,4)*5);
if (unit.hp()>unit.max_health()) then unit.update_health(unit.max_health())}

if (power_name="Telekinetic Dome"){if (marine_dome[unit_id]<3) then marine_dome[unit_id]=3;}
if (power_name="Spatial Distortion"){if (marine_spatial[unit_id]<3) then marine_spatial[unit_id]=3;}
if (power_name="Telekinetic Dome"){
if (marine_dome[unit_id]<3) then marine_dome[unit_id]=3;
}
if (power_name="Spatial Distortion"){
if (marine_spatial[unit_id]<3) then marine_spatial[unit_id]=3;
}

/*obj_ncombat.newline=string(flavour_text1)+string(flavour_text2)+string(flavour_text3);
obj_ncombat.newline_color="blue";
Expand Down
Loading