3 private const float TIME_TO_CRAFT = 3.0;
5 override void CreateActionComponent()
13 protected bool m_IsFeatherInHands;
24 m_Text =
"#STR_CraftBolt1";
28 override void CreateConditionComponents()
34 protected bool IsFeatherType(
string itemInHandsType)
36 return itemInHandsType ==
"ChickenFeather";
41 if (IsFeatherType(item.ClassName()))
44 if (target.GetObject())
45 return (target.GetObject().ClassName() ==
"Ammo_ImprovisedBolt_1");
47 else if (target.GetObject())
50 return IsFeatherType(target.GetObject().ClassName());
55 override void OnStartServer(
ActionData action_data)
57 m_IsFeatherInHands = IsFeatherType(action_data.m_MainItem.ClassName());
58 m_ResultEntity =
null;
61 override void OnFinishProgressServer(
ActionData action_data)
68 if (m_IsFeatherInHands)
71 feather = action_data.m_MainItem;
78 feather =
ItemBase.Cast(action_data.m_Target.GetObject());
81 if (!bolt || !feather)
87 bolt.ServerAcquireCartridge(dmg, type);
91 type = m_ResultEntity.ConfigGetString(
"Ammo");
92 if (m_ResultEntity.GetAmmoCount() < m_ResultEntity.GetAmmoMax())
94 m_ResultEntity.ServerStoreCartridge(dmg, type);
101 m_ResultEntity =
Ammunition_Base.Cast(action_data.m_Player.SpawnEntityOnGroundPos(
"Ammo_ImprovisedBolt_2", action_data.m_Player.GetPosition()));
102 type = m_ResultEntity.ConfigGetString(
"Ammo");
103 m_ResultEntity.ServerSetAmmoCount(0);
104 m_ResultEntity.ServerStoreCartridge(dmg, type);
105 m_ResultEntity.SetHealth01(
"",
"", bolt.GetHealth01(
"",
""));
108 feather.AddQuantity(-1);