3 override bool _WB_GetCustomTitle(BaseContainer source, out
string title)
5 title = source.GetClassName();
6 title.Replace(
"SCR_ScenarioFrameworkMedicalAction",
"");
7 string sOriginal = title;
8 SplitStringByUpperCase(sOriginal, title);
12 protected void SplitStringByUpperCase(
string input, out
string output)
15 bool wasPreviousUpperCase;
17 for (
int i, count = input.Length(); i < count; i++)
19 asciiChar = input.ToAscii(i);
20 bool isLowerCase = (asciiChar > 96 && asciiChar < 123);
21 if (i > 0 && !wasPreviousUpperCase && !isLowerCase)
23 output +=
" " + asciiChar.AsciiToString();
24 wasPreviousUpperCase =
true;
29 wasPreviousUpperCase =
false;
30 output += asciiChar.AsciiToString();
38 class SCR_ScenarioFrameworkActionMedical : SCR_ScenarioFrameworkActionBase
43 [
Attribute(
desc:
"Medical actions that will be executed on target entity")];
44 ref array<ref SCR_ScenarioFrameworkMedicalAction> m_aMedicalActions;
54 Print(
string.Format(
"ScenarioFramework Action: Getter not found for Action %1.",
this), LogLevel.ERROR);
58 SCR_ScenarioFrameworkParam<IEntity> entityWrapper = SCR_ScenarioFrameworkParam<IEntity>.Cast(m_Getter.Get());
61 Print(
string.Format(
"ScenarioFramework Action: Issue with Getter detected for Action %1.",
this), LogLevel.ERROR);
65 IEntity entity = IEntity.Cast(entityWrapper.GetValue());
68 Print(
string.Format(
"ScenarioFramework Action: Entity not found for Action %1.",
this), LogLevel.ERROR);
72 SCR_ChimeraCharacter character = SCR_ChimeraCharacter.Cast(entity);
75 Print(
string.Format(
"ScenarioFramework Action: Entity is not ChimeraCharacter for Action %1.",
this), LogLevel.ERROR);
79 foreach (SCR_ScenarioFrameworkMedicalAction medicalAction : m_aMedicalActions)
81 medicalAction.Init(character);
88 class SCR_ScenarioFrameworkMedicalAction
95 void Init(SCR_ChimeraCharacter character)
100 Print(
string.Format(
"ScenarioFramework Action: Character Damage Manager Component not found for Action %1.",
this), LogLevel.ERROR);
113 class SCR_ScenarioFrameworkMedicalActionSetBlood : SCR_ScenarioFrameworkMedicalAction
115 [
Attribute(defvalue:
"6000", uiwidget: UIWidgets.Slider,
desc:
"Character blood hit zone value",
params:
"0 6000 0.001")]
124 Print(
string.Format(
"ScenarioFramework Action: Blood Hit Zone not found for Action %1.",
this), LogLevel.ERROR);
128 bloodHitZone.SetHealth(m_fBloodValue);
134 class SCR_ScenarioFrameworkMedicalActionSetResilience : SCR_ScenarioFrameworkMedicalAction
136 [
Attribute(defvalue:
"100", uiwidget: UIWidgets.Slider,
desc:
"Character resilience hit zone value",
params:
"0 100 0.001")]
137 float m_fResilienceValue;
143 if (!resilienceHitZone)
145 Print(
string.Format(
"ScenarioFramework Action: Resilience Hit Zone not found for Action %1.",
this), LogLevel.ERROR);
149 resilienceHitZone.SetHealth(m_fResilienceValue);
155 class SCR_ScenarioFrameworkMedicalActionRemoveAllBleedings : SCR_ScenarioFrameworkMedicalAction
166 class SCR_ScenarioFrameworkMedicalActionRemoveGroupBleeding : SCR_ScenarioFrameworkMedicalAction
180 class SCR_ScenarioFrameworkMedicalActionAddParticularBleeding : SCR_ScenarioFrameworkMedicalAction
182 [
Attribute(uiwidget: UIWidgets.EditBox,
desc:
"Which hit zone will start bleeding")];
183 string m_sHitZoneName;
194 class SCR_ScenarioFrameworkMedicalActionAddRandomBleeding : SCR_ScenarioFrameworkMedicalAction
205 class SCR_ScenarioFrameworkMedicalActionSetTourniquettedGroup : SCR_ScenarioFrameworkMedicalAction
207 [
Attribute(
"10", UIWidgets.ComboBox,
"Select Character hit zone group to add/remove tourniquets",
"", ParamEnumArray.FromEnum(
ECharacterHitZoneGroup))]
210 [
Attribute(defvalue:
"{D70216B1B2889129}Prefabs/Items/Medicine/Tourniquet_01/Tourniquet_US_01.et",
desc:
"Resource name of the Tourniquet you want to use")]
211 ResourceName m_sTourniquetPrefab;
213 [
Attribute(defvalue:
"1", uiwidget: UIWidgets.CheckBox,
desc:
"Whether target hit zone group is tourniquetted or not")]
222 if (!tourniquetStorage)
224 Print(
string.Format(
"ScenarioFramework Action: Tourniquet Storage Component not found for Action %1.",
this), LogLevel.ERROR);
228 tourniquetStorage.RemoveTourniquetFromSlot(m_eCharacterHitZoneGroup,
m_DamageManager.GetOwner());
233 Resource resource = Resource.Load(m_sTourniquetPrefab);
234 if (!resource && !resource.IsValid())
237 EntitySpawnParams spawnParams =
new EntitySpawnParams();
239 spawnParams.TransformMode = ETransformMode.WORLD;
241 IEntity tourniquet =
GetGame().SpawnEntityPrefab(resource,
GetGame().GetWorld(), spawnParams);
245 SCR_ConsumableItemComponent consumableItemComp = SCR_ConsumableItemComponent.Cast(tourniquet.FindComponent(SCR_ConsumableItemComponent));
246 if (!consumableItemComp)
249 SCR_ConsumableEffectBase consumableEffect = consumableItemComp.GetConsumableEffect();
250 if (!consumableEffect)
254 params.SetEntity(tourniquet);
255 params.SetAllowMovementDuringAction(
false);
256 params.SetKeepInHandAfterSuccess(
false);
265 class SCR_ScenarioFrameworkMedicalActionSetSalineBaggedGroup : SCR_ScenarioFrameworkMedicalAction
267 [
Attribute(defvalue:
"{00E36F41CA310E2A}Prefabs/Items/Medicine/SalineBag_01/SalineBag_US_01.et",
desc:
"Resource name of the Saline bag you want to use")]
268 ResourceName m_sSalineBagPrefab;
273 Resource resource = Resource.Load(m_sSalineBagPrefab);
277 EntitySpawnParams spawnParams =
new EntitySpawnParams();
279 spawnParams.TransformMode = ETransformMode.WORLD;
281 IEntity salineBag =
GetGame().SpawnEntityPrefab(resource,
GetGame().GetWorld(), spawnParams);
285 SCR_ConsumableItemComponent consumableItemComp = SCR_ConsumableItemComponent.Cast(salineBag.FindComponent(SCR_ConsumableItemComponent));
286 if (!consumableItemComp)
289 SCR_ConsumableEffectBase consumableEffect = consumableItemComp.GetConsumableEffect();
290 if (!consumableEffect)
299 class SCR_ScenarioFrameworkMedicalActionSetPermitUnconsciousness : SCR_ScenarioFrameworkMedicalAction
301 [
Attribute(defvalue:
"true", uiwidget: UIWidgets.CheckBox,
desc:
"Whether unconsciousness is allowed for this particular character")]
313 class SCR_ScenarioFrameworkMedicalActionSetBleedingRate : SCR_ScenarioFrameworkMedicalAction
315 [
Attribute(defvalue:
"1", uiwidget: UIWidgets.Slider,
desc:
"Character bleeding rate multiplier",
params:
"0 5 0.001")]
316 float m_fBleedingRate;
327 class SCR_ScenarioFrameworkMedicalActionSetRegenerationRate : SCR_ScenarioFrameworkMedicalAction
329 [
Attribute(defvalue:
"1", uiwidget: UIWidgets.Slider,
desc:
"Character regeneration rate multiplier",
params:
"0 5 0.001")]
330 float m_fRegeneration;