Skip to content

Commit 83e3552

Browse files
committed
Adjusting perils and fixing broken stuff
There is still a crash with power_index going above power name array length.
1 parent b5c5568 commit 83e3552

3 files changed

Lines changed: 36 additions & 22 deletions

File tree

objects/obj_ncombat/KeyPress_13.gml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function reset_combat_message_arrays(){
9191
}
9292
}
9393
if (timer_stage=1) or (timer_stage=5){
94-
if (global_perils>0) then global_perils-=0.1;
94+
if (global_perils>0) then global_perils-=0.04;
9595
if (global_perils<0) then global_perils=0;
9696
turns+=1;
9797

scripts/scr_perils_table/scr_perils_table.gml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ function scr_perils_table(peril_roll, unit, psy_discipline, power_name, unit_id,
108108
return flavour_text2;
109109
}],
110110
[79, function(peril_roll, unit, psy_discipline, power_name, unit_id, book_powers){
111-
obj_ncombat.global_perils+=1;
111+
obj_ncombat.global_perils+=0.2;
112112
var flavour_text2="Wind shrieks and blood pours from the sky! The warp feels unstable.";
113113
return flavour_text2;
114114
}],

scripts/scr_powers/scr_powers.gml

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ function scr_powers(power_set, power_count, enemy_target, unit_id) {
6868
var weapon_two = unit.get_weapon_two_data()
6969
target_unit = enemy_target;
7070
power_index = power_count;
71+
show_debug_message(power_set);
7172
psy_discipline = convert_power_letter(power_set);
7273
var flavour_text1 = "",
7374
flavour_text2 = "",
@@ -102,41 +103,47 @@ function scr_powers(power_set, power_count, enemy_target, unit_id) {
102103
var disciplines_data = {
103104
"minor_nu": {
104105
"powers": ["Wave of Entropy", "Insect Swarm", "Blood Dementia"],
105-
"perils_chance": 1,
106+
"perils_chance": 0.10,
106107
"perils_strength": 10
107108
},
108109
"minor_nu_daemon": {
109110
"powers": ["Wave of Entropy", "Insect Swarm", "Blood Dementia", "Putrid Vomit"],
110-
"perils_chance": 3,
111+
"perils_chance": 0.30,
111112
"perils_strength": 30
112113
},
113114
"minor_tz_daemon": {
114115
"powers": ["Wave of Change", "Warp Bolts", "Warp Beam", "Iron Arm"],
115-
"perils_chance": 3,
116+
"perils_chance": 0.30,
116117
"perils_strength": 30
117118
},
118119
"minor_sl_daemon": {
119120
"powers": ["Warp Bolts", "Rainbow Beam", "Hysterical Frenzy", "Symphony of Pain"],
120-
"perils_chance": 3,
121+
"perils_chance": 0.30,
121122
"perils_strength": 30
122123
},
123124
"minor_default": {
124-
"powers": ["Avenge", "Spatial Distortion", "Stormbringer"]
125+
"powers": ["Avenge", "Spatial Distortion", "Stormbringer"],
126+
"perils_chance": 0,
127+
"perils_strength": 0
125128
},
126129
"minor_telekenesis": {
127-
"powers": ["Spatial Distortion", "Telekinetic Dome", "Vortex of Doom"]
130+
"powers": ["Spatial Distortion", "Telekinetic Dome", "Vortex of Doom"],
131+
"perils_chance": 0,
132+
"perils_strength": 0
128133
},
129134
"minor_biomancy": {
130135
"powers": ["Haemorrhage", "Regenerate", "Iron Arm", "Insect Swarm"],
131-
"perils_chance": 1,
136+
"perils_chance": 0.10,
132137
"perils_strength": 10
133138
},
134139
"minor_pyromancy": {
135-
"powers": ["Inferno", "Sun Burst", "Molten Beam"]
140+
"powers": ["Inferno", "Sun Burst", "Molten Beam"],
141+
"perils_chance": 0,
142+
"perils_strength": 0
136143
},
137144
"minor_what_the_fuck_man": {
138145
"powers": ["Blood Dementia", "Spatial Distortion", "Haemorrhage"],
139-
"perils_chance": 2,
146+
"perils_chance": 0.20,
140147
"perils_strength": 20
141148
},
142149
"hacks": {
@@ -166,9 +173,16 @@ function scr_powers(power_set, power_count, enemy_target, unit_id) {
166173
}
167174
var disciplines_array = struct_get_names(disciplines_data);
168175
for (var i = 0; i < array_length(disciplines_array); i++) {
169-
if (string_count(disciplines_array[i], selected_discipline) > 0) {
176+
if (disciplines_array[i] == selected_discipline) {
170177
var powers_array = disciplines_data[$ disciplines_array[i]].powers;
171-
if (using_tome) then power_index = irandom(array_length(powers_array));
178+
if (using_tome){
179+
power_index = irandom(array_length(powers_array));
180+
tome_perils_chance = disciplines_data[$ disciplines_array[i]].perils_chance;
181+
tome_perils_strength = disciplines_data[$ disciplines_array[i]].perils_strength;
182+
}
183+
show_debug_message(selected_discipline);
184+
show_debug_message(powers_array);
185+
show_debug_message(power_index);
172186
power_name = powers_array[power_index];
173187
}
174188
}
@@ -785,23 +799,23 @@ function scr_powers(power_set, power_count, enemy_target, unit_id) {
785799

786800
perils_strength += tome_perils_strength;
787801
if scr_has_disadv("Warp Touched") {
788-
perils_chance += 1;
789-
perils_strength += 20;
802+
perils_chance += 0.25;
803+
perils_strength += 25;
790804
}
791805
if scr_has_disadv("Shitty Luck") {
792-
perils_chance += 1;
806+
perils_chance += 0.25;
793807
perils_strength += 25;
794808
}
795809
perils_strength -= (marine_exp[unit_id] * 0.25);
796810

797811
perils_chance += tome_perils_chance;
798812
perils_chance += obj_ncombat.global_perils;
799-
perils_chance -= (marine_exp[unit_id] * 0.01);
813+
perils_chance -= (marine_exp[unit_id] * 0.002);
800814

801815
if (binders_adv) { // I hope you like demons
802-
perils_chance -= 0.8;
816+
perils_chance -= 0.5;
817+
perils_strength += 40;
803818
if (perils_strength <= 47) then perils_strength = 48;
804-
else perils_strength += 20;
805819
}
806820

807821
if (has_hood){
@@ -812,9 +826,9 @@ function scr_powers(power_set, power_count, enemy_target, unit_id) {
812826
perils_strength = max(perils_strength, 15);
813827
perils_chance = max(perils_chance, 0.05);
814828

815-
show_debug_message("Peril of the Warp Chance: " + string(perils_chance));
816-
show_debug_message("Roll: " + string(perils_roll));
817-
show_debug_message("Peril of the Warp Strength: " + string(perils_strength));
829+
// show_debug_message("Peril of the Warp Chance: " + string(perils_chance));
830+
// show_debug_message("Roll: " + string(perils_roll));
831+
// show_debug_message("Peril of the Warp Strength: " + string(perils_strength));
818832

819833
if (perils_roll <= perils_chance) {
820834
if (obj_ncombat.sorcery_seen = 1) then obj_ncombat.sorcery_seen = 0;

0 commit comments

Comments
 (0)