Updated damage

This commit is contained in:
Nikolai V Chr
2020-02-08 19:11:04 +01:00
parent a8760a53d1
commit eae4e138b0
26 changed files with 13254 additions and 806 deletions
+2
View File
@@ -97,6 +97,8 @@
<z-offset-min-m type="float">100.0</z-offset-min-m>
<z-offset-max-m type="float">2000.0</z-offset-max-m>
</current-view>
<chase-distance-m type="double" archive="y">-450.0</chase-distance-m>
<hud>
<path n="1">Aircraft/Frigate/Hud/hud.xml</path>
+47 -305
View File
@@ -5,318 +5,28 @@
<name>Vinson HUD</name>
<enable3d>false</enable3d>
<!-- <tape>
<name>Rel Brg</name>
<x>-100</x>
<y>190</y>
<width>200</width>
<height>28</height>
<input>
<property>/sim/current-view/heading-offset-rel-deg</property>
</input>
<display-span>25.0</display-span>
<option>top</option>
<major-divisions>5</major-divisions>
<minor-divisions>1</minor-divisions>
<tick-bottom>false</tick-bottom>
<tick-top>false</tick-top>
<tick-right>true</tick-right>
<tick-left>true</tick-left>
<cap-bottom>true</cap-bottom>
<cap-top>false</cap-top>
<cap-right>false</cap-right>
<cap-left>false</cap-left>
<marker-offset>0.0</marker-offset>
<enable-pointer>true</enable-pointer>
<pointer-type>fixed</pointer-type>
<tick-type>line</tick-type>
<tick-length>variable</tick-length>
</tape> -->
<ladder>
<name>Ladder</name>
<type>pitch</type>
<x>-60</x>
<y>-90</y>
<width>120</width>
<height>180</height>
<condition>
<equals>
<property>/sim/current-view/name</property>
<value>Approach View</value>
</equals>
</condition>
<roll-input>
<property>/orientation/roll-deg</property>
<factor>-1.0</factor>
</roll-input>
<pitch-input>
<property>/orientation/pitch-deg</property>
<factor>-1.0</factor>
</pitch-input>
<compression-factor>30</compression-factor>
<display-span>8</display-span>
<divisions>1.0</divisions>
<screen-hole>100</screen-hole>
<lbl-pos>0</lbl-pos>
<glide-slope>0.0</glide-slope>
<enable-fuselage-ref-line>false</enable-fuselage-ref-line>
<enable-target-spot>false</enable-target-spot>
<enable-target-markers>true</enable-target-markers>
<enable-velocity-vector>false</enable-velocity-vector>
<enable-drift-marker>false</enable-drift-marker>
<enable-alpha-bracket>false</enable-alpha-bracket>
<enable-energy-marker>false</enable-energy-marker>
<enable-climb-dive-marker>false</enable-climb-dive-marker>
<enable-glide-slope-marker>false</enable-glide-slope-marker>
<enable-energy-worm>false</enable-energy-worm>
<enable-waypoint-marker>false</enable-waypoint-marker>
<enable-zenith>false</enable-zenith>
<enable-nadir>false</enable-nadir>
<enable-hat>false</enable-hat>
</ladder>
<label>
<name>Wind Angle Runway</name>
<x>-300</x>
<y>190</y>
<width>200</width>
<height>25</height>
<prefix> Wind Angle Runway: </prefix>
<postfix> deg</postfix>
<halign>left</halign>
<format>%03.0f</format>
<box>true</box>
<input>
<property>/orientation/relative-wind-deg</property>
</input>
</label>
<label>
<name>Height</name>
<x>-300</x>
<y>80</y>
<width>200</width>
<height>25</height>
<condition>
<or>
<equals>
<property>/sim/current-view/name</property>
<value>Landing Signal Officer View</value>
</equals>
<equals>
<property>/sim/current-view/name</property>
<value>Approach View</value>
</equals>
</or>
</condition>
<box>false</box>
<prefix>HEIGHT: </prefix>
<halign>left</halign>
<input>
<property>/sim/current-view/height</property>
</input>
<blinking>
<interval>0.25</interval>
<condition>
<and>
<equals>
<property>/sim/current-view/height</property>
<value>VERY LOW</value>
</equals>
<less-than>
<property>/sim/current-view/distance</property>
<value>1</value>
</less-than>
</and>
</condition>
</blinking>
</label>
<label>
<name>Gear</name>
<x>-300</x>
<y>60</y>
<width>200</width>
<height>25</height>
<condition>
<or>
<equals>
<property>/sim/current-view/name</property>
<value>Landing Signal Officer View</value>
</equals>
<equals>
<property>/sim/current-view/name</property>
<value>Approach View</value>
</equals>
</or>
</condition>
<box>false</box>
<prefix>GEAR: </prefix>
<halign>left</halign>
<input>
<property>/sim/current-view/gear</property>
</input>
<blinking>
<interval>0.25</interval>
<condition>
<and>
<less-than>
<property>/sim/current-view/gear</property>
<value>1</value>
</less-than>
<less-than>
<property>/sim/current-view/distance</property>
<value>1</value>
</less-than>
</and>
</condition>
</blinking>
</label>
<label>
<name>Flap</name>
<x>-300</x>
<y>40</y>
<width>200</width>
<height>25</height>
<condition>
<or>
<equals>
<property>/sim/current-view/name</property>
<value>Landing Signal Officer View</value>
</equals>
<equals>
<property>/sim/current-view/name</property>
<value>Approach View</value>
</equals>
</or>
</condition>
<box>false</box>
<prefix>FLAPS: </prefix>
<halign>left</halign>
<input>
<property>/sim/current-view/flap</property>
</input>
<blinking>
<interval>0.25</interval>
<condition>
<and>
<less-than>
<property>/sim/current-view/flap</property>
<value>1</value>
</less-than>
<less-than>
<property>/sim/current-view/distance</property>
<value>1</value>
</less-than>
</and>
</condition>
</blinking>
</label>
<label>
<name>Hook</name>
<x>-300</x>
<y>20</y>
<width>200</width>
<height>25</height>
<condition>
<or>
<equals>
<property>/sim/current-view/name</property>
<value>Landing Signal Officer View</value>
</equals>
<equals>
<property>/sim/current-view/name</property>
<value>Approach View</value>
</equals>
</or>
</condition>
<box>false</box>
<prefix>HOOK: </prefix>
<halign>left</halign>
<input>
<property>/sim/current-view/hook</property>
</input>
</label>
<label>
<name>Magnetic Heading</name>
<name>Heading</name>
<x>-300</x>
<y>-225</y>
<width>200</width>
<height>25</height>
<prefix> Mag. Heading: </prefix>
<prefix> Heading: </prefix>
<postfix> deg</postfix>
<halign>left</halign>
<format>%03.0f</format>
<box>true</box>
<input>
<property>/orientation/heading-magnetic-deg</property>
<property>/orientation/heading-deg</property>
</input>
</label>
<label>
<name>Magnetic Heading Runway</name>
<x>-300</x>
<y>-200</y>
<width>200</width>
<height>25</height>
<prefix> Mag. Heading Runway: </prefix>
<postfix> deg</postfix>
<halign>left</halign>
<format>%03.0f</format>
<box>true</box>
<input>
<property>/orientation/heading-runway-magnetic-deg</property>
</input>
</label>
<label>
<name>Wind Speed Runway</name>
<x>100</x>
<y>190</y>
<width>200</width>
<height>25</height>
<prefix> Wind Speed Runway: </prefix>
<postfix> kts</postfix>
<halign>left</halign>
<format>%2.0f</format>
<box>true</box>
<input>
<property>/velocities/wind-speed-runway-kt</property>
</input>
</label>
<label>
<name>Speed</name>
<x>100</x>
<x>0</x>
<y>-225</y>
<width>200</width>
<width>125</width>
<height>25</height>
<prefix> Speed: </prefix>
<postfix> kts</postfix>
@@ -329,18 +39,50 @@
</label>
<label>
<name>Target Speed</name>
<x>100</x>
<y>-200</y>
<width>200</width>
<name>damage</name>
<x>-150</x>
<y>-175</y>
<width>125</width>
<height>25</height>
<prefix> Target Speed: </prefix>
<postfix> kts</postfix>
<prefix> Integrity: </prefix>
<postfix> %%</postfix>
<halign>left</halign>
<format>%2.1f</format>
<format>%3.1f</format>
<box>true</box>
<input>
<property>/carrier/fbw/target/groundspeed-kt</property>
<property>/sam/damage</property>
</input>
</label>
<label>
<name>cs</name>
<x>0</x>
<y>-175</y>
<width>125</width>
<height>25</height>
<prefix> Callsign: </prefix>
<postfix></postfix>
<halign>left</halign>
<format>%s</format>
<box>true</box>
<input>
<property>/sim/multiplay/callsign</property>
</input>
</label>
<label>
<name>tower</name>
<x>150</x>
<y>-225</y>
<width>200</width>
<height>25</height>
<prefix> Placement near: </prefix>
<postfix></postfix>
<halign>left</halign>
<format>%s</format>
<box>true</box>
<input>
<property>/sim/tower/airport-id</property>
</input>
</label>
+52 -7
View File
@@ -30,6 +30,7 @@ var TRUE = 1;
var FALSE = 0;
var hp = hp_max;
setprop("sam/damage", math.max(0,100*hp/hp_max));#used in HUD
var cannon_types = {
#
@@ -43,12 +44,14 @@ var cannon_types = {
" Gun Splash On ": 0.100, # 30mm
" GSh-30 hit": 0.100, # 30mm
" GAU-8/A hit": 0.100, # 30mm
" Mk3Z hit": 0.100, # 30mm Jaguar
" BK27 cannon hit": 0.070, # 27mm
" GSh-23 hit": 0.065, # 23mm
" M61A1 shell hit": 0.050, # 20mm
" 50 BMG hit": 0.015, # 12.7mm (non-explosive)
" 7.62 hit": 0.005, # 7.62mm (non-explosive)
" Hydra-70 hit": 0.25, #
" 7.62 hit": 0.005, # 7.62mm (non-explosive)
" Hydra-70 hit": 0.250, # F-16
" SNEB hit": 0.250, # Jaguar
};
# lbs of warheads is explosive+fragmentation+fuse, so total warhead mass.
@@ -59,13 +62,16 @@ var warhead_lbs = {
"AGM-84": 488.00,
"AGM-88": 146.00,
"AGM65": 200.00,
"AGM-119": 264.50,
"AGM-154A": 493.00,
"AGM-158": 1000.00,
"ALARM": 450.00,
"AM39-Exocet": 364.00,
"AS-37-Martel": 330.00,
"AS30L": 529.00,
"CBU-87": 100.00,# bomblet warhead. Mix of armour piecing and HE. 100 due to need to be able to kill buk-m2.
"BL755": 100.00,# 800lb bomblet warhead. Mix of armour piecing and HE. 100 due to need to be able to kill buk-m2.
"CBU-87": 100.00,# bomblet warhead. Mix of armour piecing and HE. 100 due to need to be able to kill buk-m2.
"CBU-105": 100.00,# bomblet warhead. Mix of armour piecing and HE. 100 due to need to be able to kill buk-m2.
"Exocet": 364.00,
"FAB-100": 92.59,
"FAB-250": 202.85,
@@ -73,7 +79,7 @@ var warhead_lbs = {
"GBU-12": 190.00,
"GBU-24": 945.00,
"GBU-31": 945.00,
"GBU-54" 190.00,
"GBU-54": 190.00,
"GBU12": 190.00,
"GBU16": 450.00,
"HVAR": 7.50,#P51
@@ -86,6 +92,7 @@ var warhead_lbs = {
"M90": 10.00,# bomblet warhead. x3 of real mass.
"MK-82": 192.00,
"MK-83": 445.00,
"MK-83HD": 445.00,
"MK-84": 945.00,
"OFAB-100": 92.59,
"RB-04E": 661.00,
@@ -96,7 +103,7 @@ var warhead_lbs = {
"RN-18T": 1200.00, #fictional, thermobaeric replacement for the RN-28 nuclear bomb
"RS-2US": 28.66,
"S-21": 245.00,
"S-24": 271.00,
"S-24": 271.00,
"SCALP": 992.00,
"Sea Eagle": 505.00,
"SeaEagle": 505.00,
@@ -120,6 +127,7 @@ var warhead_air_lbs = {
"KN-06": 315.00,
"M317": 145.00,
"Magic-2": 27.00,
"Majic": 26.45,
"Matra MICA": 30.00,
"Matra R550 Magic 2": 27.00,
"MATRA-R530": 55.00,
@@ -147,12 +155,15 @@ var warhead_air_lbs = {
"RB-74": 20.80,
"RB-99": 44.00,
"S530D": 66.00,
"S48N6": 330.00,# 48N6 from S-300pmu
};
var cluster = {
# cluster munition list
"M90": nil,
"CBU-87": nil,
"CBU-105": nil,
"BL755": nil,
};
var fireMsgs = {
@@ -232,7 +243,7 @@ var incoming_listener = func {
probability = (maxDist/hpDist)*probability;
}
var failed = fail_systems(probability, hp_max);
var percent = 100 * prob;
var percent = 100 * probability;
printf("Took %.1f%% damage from %s clusterbomb at %0.1f meters from bomblet. %s systems was hit", percent,type,distance,failed);
nearby_explosion();
return;
@@ -358,14 +369,48 @@ var fail_systems = func (probability, factor = 100) {#this factor needs tuning a
var mode_list = keys(failure_modes);
var failed = 0;
foreach(var failure_mode_id; mode_list) {
#print(failure_mode_id);
if (rand() < probability) {
FailureMgr.set_failure_level(failure_mode_id, 1);
failed += 1;
if (failure_mode_id == "Engines/engine") {
# fail UH1 yasim:
setprop("sim/model/uh1/state",0);
setprop("controls/engines/engine/magnetos", 0);
#set a listener so that if a restart is attempted, it'll fail.
yasim_list = setlistener("sim/model/uh1/state",func {setprop("sim/model/uh1/state",0);});
}
}
}
if (rand() < probability) {
# fail UH1 yasim:
setprop("sim/model/uh1/state",0);
setprop("controls/engines/engine/magnetos", 0);
#set a listener so that if a restart is attempted, it'll fail.
if (yasim_list == nil) {
yasim_list = setlistener("sim/model/uh1/state",func {setprop("sim/model/uh1/state",0);});
}
}
return failed;
}
};
var yasim_list = nil;
var repairYasim = func {
if (yasim_list != nil) {
removelistener(yasim_list);
yasim_list = nil;
}
setprop("sim/crashed", 0);
var failure_modes = FailureMgr._failmgr.failure_modes;
var mode_list = keys(failure_modes);
foreach(var failure_mode_id; mode_list) {
FailureMgr.set_failure_level(failure_mode_id, 0);
}
}
setlistener("/sim/signals/reinit", repairYasim);
hp_f = [hp_max,hp_max,hp_max,hp_max,hp_max,hp_max,hp_max];
@@ -519,4 +564,4 @@ var re_init = func {
}
}
setlistener("/sim/signals/reinit", re_init, 0, 0);
setlistener("/sim/signals/reinit", re_init, 0, 0);
+2 -2
View File
@@ -87,7 +87,7 @@ var PositionUpdater = func () {
# Update heading
var course = heading + rudder * heading_ps * dt;
setprop("/orientation/heading-deg", course);
setprop("velocities/groundspeed-kt",speed);
} elsif ( getprop("/carrier/sunk") == 1 ) {
setprop("/carrier/fbw/target/groundspeed-kt",0);
setprop("/controls/engines/engine/throttle",0);
@@ -100,7 +100,7 @@ var PositionUpdater = func () {
setprop("/position/altitude-ft",getprop("/position/altitude-ft") - ( sink_rate ));
setprop("/carrier/pitch-offset",getprop("/carrier/pitch-offset") + ( pitch_rate ));
setprop("/carrier/roll-offset",getprop("/carrier/roll-offset") + ( roll_rate ));
setprop("velocities/groundspeed-kt",0);
print("sunk");
}