Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
paintitem.c
Go to the documentation of this file.
2{
4 static void Paint(ItemBase item_tool, ItemBase item_target, string base_name, PlayerBase player, float specialty_weight = 0)
5 {
6 string spray_color = item_tool.ConfigGetString("color");
7 string item_color = item_target.ConfigGetString("color");
8
9 string new_class_name = base_name + "_" + spray_color;
10 PaintItem.SwitchItems(item_target, new_class_name, player);
11 }
12
13 static bool CanPaintItem(ItemBase item_tool, ItemBase item_target)
14 {
15 string spray_color = item_tool.ConfigGetString("color");
16 string item_color = item_target.ConfigGetString("color");
17
18 if( spray_color != item_color )
19 {
20 return true;
21 }
22 else
23 {
24 return false;
25 }
26 }
27
29 static void SwitchItems (EntityAI old_item, string new_item, PlayerBase player)
30 {
31 MiscGameplayFunctions.TurnItemIntoItemEx(player, new PaintItemLambda(old_item, new_item, player));
32 }
33};
34
35
37{
38 void PaintItemLambda (EntityAI old_item, string new_item_type, PlayerBase player) { }
39};