At TNF we trying to create more hardcore and realistic environment for players, so game would be more like "Mad Max", rare decent firearms and ammo.
I thought that original repair system was too simple and casual for us, so i made some changes till we rework craft/materials more seriously:
1) weapons and armor require some tools and materials for repair, depending on quality and complexness of item (zip gun repaired by any junk with bare hands and plasma gun require expensive and rare plasma transformers and supertoolset).
2) items get bonus or penalty to repair check depending on complexness of item (zip gun +50 repair, power armor -70), so pretty much everyone could repair his low-tech equipment, but for complex stuff you should look for decent tech guy.
chunk of code
// repair by ErlKing
int type=item.GetProtoId();
switch(type)
{
case PID_SANDROBE: repair+=25;
case PID_LEATHER_JACKET: repair+=25;
if(_CritCountItem(cr,PID_POCKET_LINT)>1) cr.DeleteItem(PID_POCKET_LINT,2);
else if(_CritCountItem(cr,PID_GECKO_PELT)>0) cr.DeleteItem(PID_GECKO_PELT,1);
else if(_CritCountItem(cr,PID_GOLDEN_GECKO_PELT)>0) cr.DeleteItem(PID_GOLDEN_GECKO_PELT,1);
else if(_CritCountItem(cr,PID_BRAHMIN_SKIN)>0) cr.DeleteItem(PID_BRAHMIN_SKIN,1);
else {cr.SayMsg(SAY_NETMSG,TEXTMSG_GAME,155080); return true;}
break;
case PID_LEATHER_ARMOR: repair+=20;
case PID_CURED_LEATHER_ARMOR: repair+=20;
if(_CritCountItem(cr,PID_GECKO_PELT)>1) cr.DeleteItem(PID_GECKO_PELT,2);
else if(_CritCountItem(cr,PID_BRAHMIN_SKIN)>0) cr.DeleteItem(PID_BRAHMIN_SKIN,1);
else if(_CritCountItem(cr,PID_HARD_HIDE)>0) cr.DeleteItem(PID_HARD_HIDE,1);
else if(_CritCountItem(cr,PID_GOLDEN_GECKO_PELT)>0) cr.DeleteItem(PID_GOLDEN_GECKO_PELT,1);
else {cr.SayMsg(SAY_NETMSG,TEXTMSG_GAME,155090); return true;}
break;
case PID_LEATHER_ARMOR_MK_II: repair+=15;
if(_CritCountItem(cr,PID_GOLDEN_GECKO_PELT)>0) cr.DeleteItem(PID_GOLDEN_GECKO_PELT,1);
else if(_CritCountItem(cr,PID_HARD_HIDE)>0) cr.DeleteItem(PID_HARD_HIDE,1);
else {cr.SayMsg(SAY_NETMSG,TEXTMSG_GAME,155090); return true;}
break;
case PID_CURED_LEATHER_ARMOR_MK_II:
case PID_METAL_ARMOR:
if(_CritCountItem(cr,PID_SLEDGEHAMMER)>0)
{
if(_CritCountItem(cr,PID_METAL_TRASH)>2) cr.DeleteItem(PID_METAL_TRASH,3);
else if(_CritCountItem(cr,PID_HLAM_MEH)>1) cr.DeleteItem(PID_HLAM_MEH,2);
else if(_CritCountItem(cr,PID_HLAM2_MEH)>1) cr.DeleteItem(PID_HLAM2_MEH,2);
else if(_CritCountItem(cr,PID_METAL_LIST_MEH)>0) cr.DeleteItem(PID_METAL_LIST_MEH,1);
else if(_CritCountItem(cr,PID_IRON_PLATE)>0) cr.DeleteItem(PID_IRON_PLATE,1);
else {cr.SayMsg(SAY_NETMSG,TEXTMSG_GAME,155100); return true;}
}
else {cr.SayMsg(SAY_NETMSG,TEXTMSG_GAME,155110); return true;}
break;
case PID_METAL_ARMOR_MK_II: repair-=25;
if(_CritCountItem(cr,PID_DRILL)>0)
{
if(_CritCountItem(cr,PID_METAL_LIST_MEH)>1) cr.DeleteItem(PID_METAL_LIST_MEH,2);
else if(_CritCountItem(cr,PID_IRON_PLATE)>0) cr.DeleteItem(PID_IRON_PLATE,1);
else {cr.SayMsg(SAY_NETMSG,TEXTMSG_GAME,155130); return true;}
}
else {cr.SayMsg(SAY_NETMSG,TEXTMSG_GAME,155120); return true;}
break;
// weapon middle-tech
case PID_COMBAT_SHOTGUN: repair-=15;
case PID_SCOPED_HUNTING_RIFLE: repair-=5;
case PID_REMINGTON:
case PID_10MM_SMG:
case PID_TOMMY_GUN:
case PID_GREASE_GUN: repair-=10;
case PID_HUNTING_RIFLE:
case PID_14MM_PISTOL:
case PID_ANACONDA: repair-=15;
case PID_DESERT_EAGLE:
case PID_DESERT_EAGLE_EXT_MAG:
case PID_44_MAGNUM_REVOLVER:
case PID_44_MAGNUM_SPEEDLOADER: repair-=5;
if(_CritCountItem(cr,PID_DRILL)>0)
{
if(_CritCountItem(cr,PID_METAL_TRASH)>3) cr.DeleteItem(PID_METAL_TRASH,4);
else if(_CritCountItem(cr,PID_IRON_DETALS)>0) cr.DeleteItem(PID_IRON_DETALS,1);
else if(_CritCountItem(cr,PID_PERED_MEH)>0) cr.DeleteItem(PID_PERED_MEH,1);
else if(_CritCountItem(cr,PID_DETAL_MEH)>0) cr.DeleteItem(PID_DETAL_MEH,1);
else {cr.SayMsg(SAY_NETMSG,TEXTMSG_GAME,155220); return true;}
}
else {cr.SayMsg(SAY_NETMSG,TEXTMSG_GAME,155160); return true;}
break;
For each item or group of items there are set of materials and most cheap used for repair, if there are none at all you get message about materials or tools you need. As you see for now this script pretty simple and lack of choise for player - you cant chose material to repair with, if you want to use more expensive ones.
I dont mind some feedback, not about this suggestion being good or bad (i already know exactly how it worked out in game), but some ideas and solutions to improvement or organizing (like adding menu for optional materials using and adding bonuses/penalty/restrictions for different material choice or such).