Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear
- base_crit_pct = 9.2; %base critical chance
- base_severity_pct = 75.2; %base critical severity
- biom_crit_pct = 2; %additional crit chance on enhanced biometric torp
- biom_severity_pct = 20; % additional crit severity on enhanced biometric torp
- phot_crit_pct = 4; % additional crit chance on photon torp
- phot_severity_pct = 10; %additional severity on photon torp
- torp_damage = 5922.16; % the per shot kinetic torpedo damage
- for i = 1:1:10000 %number of tests
- seconds=120; %the number of seconds you want to run the test for
- %setup
- biom = 0; %the enhanced biomolecular photon torpedo is ready to fire
- phot = 0; %the regular photon torpedo is ready to fire
- CD = 0; %global torpedo cooldown is not active
- biomcount = 0; %no biomolecular torpedoes have been fired
- photcount = 0; %no photon torpedoes have been fired
- damage_dealt = 0; % no damage dealt yet
- for j=1:.5:seconds
- if biom == 0 && CD == 0
- biom = 6.5; %biom fires, with .5 sec act time and 6 sec CD time;
- doff1 = randi(5); %roll doffs
- if doff1 == 1
- biom = biom -5;
- end
- doff2 = randi(5);
- if doff2 == 1
- biom = biom-5;
- end
- doff3 = randi(5);
- if doff3 == 1
- biom = biom -5;
- end
- if biom < 1.5
- biom = 1.5;
- end
- CD = 1; %global torpedo cooldown is active
- biomcount = biomcount +1; %count the shot
- crit = randi(1000); %roll crit
- crith = (base_crit_pct + biom_crit_pct)*10; %crith threshold calculation
- critd = (base_severity_pct + biom_severity_pct)/100; %critical bonus
- mult = 1; %multiplier, to be modified if a crit is scored
- if crit <= crith
- mult = 1 + critd;
- end
- damage_dealt=damage_dealt + (mult)*torp_damage; %deal the damage
- end
- if phot == 0 && CD == 0
- phot = 6.5; %phot fires, with .5 sec act time and 6 sec CD time;
- doff1 = randi(5); %roll doffs
- if doff1 == 1
- phot = phot -5;
- end
- doff2 = randi(5);
- if doff2 == 1
- phot = phot-5;
- end
- doff3 = randi(5);
- if doff3 == 1
- phot = phot -5;
- end
- if phot < 1.5
- phot = 1.5;
- end
- CD = 1; %global torpedo cooldown is active
- photcount = photcount + 1; %count the shot
- crit = randi(1000); %roll crit
- crith = (base_crit_pct + phot_crit_pct)*10; %crith threshold calculation
- critd = (base_severity_pct + phot_severity_pct)/100; %critical bonus
- mult = 1; %multiplier, to be modified if a crit is scored
- if crit <= crith
- mult = 1 + critd;
- end
- damage_dealt=damage_dealt + (mult)*torp_damage; %deal the damage
- end
- if biom > 0
- biom = biom -.5;
- end
- if phot > 0
- phot = phot -.5;
- end
- if CD > 0
- CD = CD -.5;
- end
- end
- biomolecular_fired(i) = biomcount;
- photon_fired(i) = photcount;
- total_fired(i) = photcount + biomcount;
- damage(i) = damage_dealt;
- end
- average_biomolecular_fired = mean(biomolecular_fired)
- average_photon_fired = mean(photon_fired)
- average_fired = mean(total_fired)
- average_damage = mean(damage)
Advertisement
Add Comment
Please, Sign In to add comment