void pl_EquipChar(ENTITY* chara)
{
// if (equip-slot is used) : remove old entity and set new one
// {
// if (skill-pointer to armor-entity is set) { remove the old armor entity }
// skill-pointer.slot = new entity
// }
// else : not used, so remove old entity
// {
// if (skill-pointer to armor-entity is set) { remove the old armor entity }
// }
if (chara.hair > 0)
{
if (chara.phair != NULL) { ptr_remove((ENTITY*)chara.phair); chara.phair = NULL; }
chara.phair = ent_create(GEAR_HAIR[chara.hair], nullvector, pl_armor);
}
else
{
if (chara.phair != NULL) { ptr_remove((ENTITY*)chara.phair); chara.phair = NULL; }
}
if (chara.head > 0)
{
}
if (chara.chest > 0)
{
if (chara.pchest != NULL) { ptr_remove((ENTITY*)chara.pchest); chara.pchest = NULL; }
chara.pchest = ent_create(GEAR_CHEST[chara.chest], nullvector, pl_armor);
}
else
{
if (chara.pchest != NULL) { ptr_remove((ENTITY*)chara.pchest); chara.pchest = NULL; }
}
if (chara.legs > 0)
{
if (chara.plegs != NULL) { ptr_remove((ENTITY*)chara.plegs); chara.plegs = NULL; }
chara.plegs = ent_create(GEAR_LEGS[chara.legs], nullvector, pl_armor);
}
else
{
if (chara.plegs != NULL) { ptr_remove((ENTITY*)chara.plegs); chara.plegs = NULL; }
}
if (chara.feet > 0)
{
if (chara.pfeet != NULL) { ptr_remove((ENTITY*)chara.pfeet); chara.pfeet = NULL; }
chara.pfeet = ent_create(GEAR_FEET[chara.feet], nullvector, pl_armor);
}
else
{
if (chara.pfeet != NULL) { ptr_remove((ENTITY*)chara.pfeet); chara.pfeet = NULL; }
}
if (chara.shoulders > 0)
{
}
if (chara.hands > 0)
{
}
if (chara.cape > 0)
{
}
if (chara.weaponhand > 0)
{
if (chara.pweaponhand != NULL) { ptr_remove((ENTITY*)chara.pweaponhand); chara.pweaponhand = NULL; }
chara.pweaponhand = ent_create(GEAR_WEAPONHAND[chara.weaponhand], nullvector, pl_armor);
}
else
{
if (chara.pweaponhand != NULL) { ptr_remove((ENTITY*)chara.pweaponhand); chara.pweaponhand = NULL; }
}
if (chara.offhand > 0)
{
}
if (chara.secweapon > 0)
{
}
// Adapt Settings of transparency
var i;
for (i=70; i<=82; i++)
{
if ((ENTITY*)chara.skill[i] != NULL)
{
if is(chara, TRANSLUCENT)
{
set(((ENTITY*)chara.skill[i]), TRANSLUCENT);
}
else
{
reset(((ENTITY*)chara.skill[i]), TRANSLUCENT);
}
((ENTITY*)chara.skill[i]).alpha = chara.alpha;
if is(chara, INVISIBLE)
{
set(((ENTITY*)chara.skill[i]), INVISIBLE);
}
else
{
reset(((ENTITY*)chara.skill[i]), INVISIBLE);
}
}
}
}