Due to the relitave compelxity of shadowruns firearms resolution mechanics, I decided to try to write a program to analyze specific outcomes so that I would have a better understanding of how the mechanics work. If you have a copy of Matlab or similar program you can just copy and paste the code and run it. Things I have learned:

Damage value is a Huge deal, as is called shots/long bursts. If possible you should always go for a higher effective damage value.

-Wide bursts are useless in almost every situation.

-Armor is not very important except for a threshold where several points can make the difference between mostly stun damage and mostly lethal damage. An example would be with the having 20 armor instead of 17 armor gives you 40% less chance to take lethal damage, while only lowering the actual damage you will take by ~5%

-It is almost impossible to disable a moderately optimized combat character in one simple action, and almost easy to do it in two.

I'm Posting this here so that some other people can play around with it and fix bugs/learn more about how the mechanics of Shadowrun firefights ACTUALLY work.

clear all

close all

format short g

format compact

screen_size=get(0,'ScreenSize');

clc

fig=figure;

set(fig,'units','normalized','outerposition',[0 0 1 1]);

tic

for a=6:2:22

for b=4:2:10

for j=2:2:26

for n=[0,1]

for l=4:2:20

for e=[0,1]

clearvars -except a b j n l e fig

%a=12; %attack Pool

%b=6; %Gun Damage

%c=20; %Recoil Controll

d=6; %Burst Count(semi=1, short=3, long=6)

%e=1; %Narrow burst(1=yes, 0=no)

f=0; %Off hand(1=yes, 0=no)

%g=0; %called shot(1=yes, 0=no)

h=0; %range penalty

%j=12; %Defense pool

%l=7; %Armor

m=1; %Health

%n=2; %armor piercing value

o=ceil((l-3)/3); %body value

c=d-1;

g=e;

info=sprintf('Attack Pool %1.0f, Gun Damage %1.0f, Shot Count %1.0f, Narrow Burst %1.0f, Called Shot %1.0f, Defense Pool %1.0f, Armor %1.0f, Body %1.0f, Armor Piercing %1.0f',a,b,d,e,g,j,l,o,n);

i=a-4*g-2*f-(d-1-c);%total attack pool

k=j-(1-e)*(d-1)-n;%total soak pool

m=zeros(50,1);

m(1,1)=2/3;

m(2,1)=1/3;

if i>1

for x=[2:i]

m(1,x)=m(1,x-1)*2/3;

for p=[2:50]

m(p,x)=(m(p,x-1)*2/3)+(m(p-1,x-1)/3);

end

end

m=m(1:50,i);

end

if k>0

for x=[2:k+1]

m(1,x)=m(1,x-1)+(m(1+1,x-1)/3);

for p=[2:49]

m(p,x)=m(p,x-1)*2/3+(m(p+1,x-1)/3);

end

end

m=m(1:50,k+1);

end

for x=[1:50]

m1(b+e*(d-1)+g*4+x,1)=m(x,1);

end

m=m1;

%shock=stun

%lethal=physical

shock=zeros(50,1);

lethal=zeros(50,1);

oneHkill=zeros(50,1);

twoHkill=zeros(50,1);

for x=[1:50]

if x>l-n

lethal(x,1)=m(x,1);

else

shock(x,1)=m(x,1);

end

end

if l+o-n>0

for x=[2:l+o-n+1]

shock(1,x)=shock(1,x-1)+(shock(1+1,x-1)/3);

for p=[2:49]

shock(p,x)=shock(p,x-1)*2/3+(shock(p+1,x-1)/3);

end

end

shock=shock(1:50,l+o-n+1);

end

if l+o-n>0

for x=[2:l+o-n+1]

lethal(1,x)=lethal(1,x-1)+(lethal(1+1,x-1)/3);

for p=[2:49]

lethal(p,x)=lethal(p,x-1)*2/3+(lethal(p+1,x-1)/3);

end

end

lethal=lethal(1:50,l+o-n+1);

end

total=lethal+shock;

for y=[1:50]

lethal1(y,1)=sum(lethal(y:50,1));

shock1(y,1)=sum(shock(y:50,1));

end

total1=lethal1+shock1;

x=[0:49]';

plot(x(1:20),shock1(1:20).*100,'- .b',x(1:20),lethal1(1:20).*100,'- .r',x(1:20),total1(1:20).*100,'.k',x(1:20),shock(1:20).*100,'-. .b',x(1:20),lethal(1:20).*100,'-. .r',x(1:20),total(1:20).*100,'ok');

axis([0 20 0 100])

grid minor

xlabel('Damge')

ylabel('% Chance, Solid: At least this much damage, Dashed/Hollow: Exactly this much damage')

legend('Shock Damage','Lethal Damage','Total')

title(info)

print(fig,info,'-dpng')

end

end

end

end

end

end

toc