Update damage.nas

This commit is contained in:
J Maverick 16 2018-05-04 16:22:36 +02:00 committed by GitHub
parent dd592d26c4
commit f95eeb9e7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,8 +21,10 @@ var cannon_types = {
" GAU-8/A hit": 0.10, # 30mm " GAU-8/A hit": 0.10, # 30mm
" BK27 cannon hit": 0.07, # 27mm " BK27 cannon hit": 0.07, # 27mm
" GSh-30 hit": 0.10, # 30mm " GSh-30 hit": 0.10, # 30mm
" GSh-23 hit": 0.065,# 23mm
" 7.62 hit": 0.005,# 7.62mm " 7.62 hit": 0.005,# 7.62mm
" 50 BMG hit": 0.015,# 12.7mm " 50 BMG hit": 0.015,# 12.7mm
" S-5 rocket hit": 0.20, #55mm
}; };
@ -54,10 +56,14 @@ var warhead_lbs = {
"SCALP": 992.00, "SCALP": 992.00,
"KN-06": 315.00, "KN-06": 315.00,
"GBU12": 190.00, "GBU12": 190.00,
"GBU-12": 190.00,
"GBU16": 450.00, "GBU16": 450.00,
"Sea Eagle": 505.00, "Sea Eagle": 505.00,
"SeaEagle": 505.00, "SeaEagle": 505.00,
"AGM65": 200.00, "AGM65": 200.00,
"AGM-65": 126.00,
"AGM-84": 488.00,
"AGM-88": 146.00,
"RB-04E": 661.00, "RB-04E": 661.00,
"RB-05A": 353.00, "RB-05A": 353.00,
"RB-75": 126.00, "RB-75": 126.00,
@ -71,11 +77,32 @@ var warhead_lbs = {
"AIM132": 22.05, "AIM132": 22.05,
"ALARM": 450.00, "ALARM": 450.00,
"STORMSHADOW": 850.00, "STORMSHADOW": 850.00,
"S-21": 245.00,
"S-24": 271.00,
"Kh-66": 244.71,
"RS-2US": 28.66,
"R-55": 20.06,
"R-3S": 16.31,
"R-3R": 16.31,
"R-13M": 16.31,
"R-60": 6.60, "R-60": 6.60,
"R-60M": 7.70,
"R-27R1": 85.98, "R-27R1": 85.98,
"R-27T1": 85.98, "R-27T1": 85.98,
"FAB-500": 564.00, "R-73E": 16.31,
"R-77": 49.60,
"RN-14T": 800.00, #fictional, thermobaeric replacement for the RN-24 nuclear bomb
"RN-18T": 1200.00, #fictional, thermobaeric replacement for the RN-28 nuclear bomb
"ZB-250": 236.99,
"ZB-500": 473.99,
"KH-25MP": 197.53,
"FAB-100": 92.59,
"OFAB-100": 92.59,
"FAB-250": 202.85,
"FAB-500": 564.38,
"KAB-500": 564.38,
"Exocet": 364.00, "Exocet": 364.00,
"HVAR": 7.50,#P51
}; };
var fireMsgs = { var fireMsgs = {
@ -111,6 +138,7 @@ var incoming_listener = func {
var last_vector = split(":", last); var last_vector = split(":", last);
var author = last_vector[0]; var author = last_vector[0];
var callsign = getprop("sim/multiplay/callsign"); var callsign = getprop("sim/multiplay/callsign");
callsign = size(callsign) < 8 ? callsign : left(callsign,7);
if (size(last_vector) > 1 and author != callsign) { if (size(last_vector) > 1 and author != callsign) {
# not myself # not myself
#print("not me"); #print("not me");
@ -229,6 +257,11 @@ var incoming_listener = func {
} }
} elsif (cannon_types[last_vector[1]] != nil) { } elsif (cannon_types[last_vector[1]] != nil) {
if (size(last_vector) > 2 and last_vector[2] == " "~callsign) { if (size(last_vector) > 2 and last_vector[2] == " "~callsign) {
if (size(last_vector) < 4) {
# msg is either missing number of hits, or has no trailing dots from spam filter.
print('"'~last~'" is not a legal hit message, tell the shooter to upgrade his OPRF plane :)');
return;
}
var last3 = split(" ", last_vector[3]); var last3 = split(" ", last_vector[3]);
if(size(last3) > 2 and size(last3[2]) > 2 and last3[2] == "hits" ) { if(size(last3) > 2 and size(last3[2]) > 2 and last3[2] == "hits" ) {
var probability = cannon_types[last_vector[1]]; var probability = cannon_types[last_vector[1]];