• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Compiling Help WeaponType Fist TFS 1.0

Dennyz Dias

New Member
Joined
May 1, 2016
Messages
6
Reaction score
0
Someone help me with WeaponType Fist need TFS 1.0 add the option
<Attribute key = " weaponType " value = " fist " />
the game already fis several changes in the source but to enter the game does not happen nothing

follow my changes in source

const.h

enum WeaponType_t {
WEAPON_NONE = 0,
WEAPON_SWORD = 1,
WEAPON_CLUB = 2,
WEAPON_AXE = 3,
WEAPON_SHIELD = 4,
WEAPON_DIST = 5,
WEAPON_WAND = 6,
WEAPON_AMMO = 7,
WEAPON_FIST = 8
};

----------------------------------------------------------------------------------------------------------------------------

combat.cpp

void Combat::addDistanceEffect(Creature* caster, const Position& fromPos, const Position& toPos, uint8_t effect)
{
if (caster && effect == NM_SHOOT_WEAPONTYPE) {
switch (caster->getWeaponType()) {
case WEAPON_AXE:
effect = CONST_ANI_WHIRLWINDAXE;
break;
case WEAPON_SWORD:
effect = CONST_ANI_WHIRLWINDSWORD;
break;
case WEAPON_CLUB:
effect = CONST_ANI_WHIRLWINDCLUB;
break;
case WEAPON_FIST:
effect = CONST_ANI_LARGEROCK;
break;
default:
effect = CONST_ANI_NONE;
break;
}
}

-----------------------------------------------------------------------------------------------------------------------------

items.cpp

} else if (tmpStrValue == "club") {
it.weaponType = WEAPON_CLUB;
} else if (tmpStrValue == "axe") {
it.weaponType = WEAPON_AXE;
} else if (tmpStrValue == "shield") {
it.weaponType = WEAPON_SHIELD;
} else if (tmpStrValue == "distance") {
it.weaponType = WEAPON_DIST;
} else if (tmpStrValue == "wand") {
it.weaponType = WEAPON_WAND;
}else if (tmpStrValue == "ammunition") {
it.weaponType = WEAPON_AMMO;
}else if (tmpStrValue == "fist") {
it.weaponType = WEAPON_FIST;
} else {
std::cout << "[Warning - Items::parseItemNode] Unknown weaponType: " << valueAttribute.as_string() << std::endl;
}

-------------------------------------------------------------------------------------------------------------------------------------

player.cpp

WeaponType_t weaponType = item->getWeaponType();
switch (weaponType) {
case WEAPON_SWORD: {
attackSkill = getSkill(SKILL_SWORD, SKILL_LEVEL);
break;
}

case WEAPON_CLUB: {
attackSkill = getSkill(SKILL_CLUB, SKILL_LEVEL);
break;
}

case WEAPON_AXE: {
attackSkill = getSkill(SKILL_AXE, SKILL_LEVEL);
break;
}

case WEAPON_FIST:{
attackSkill = getSkill(SKILL_FIST, SKILL_LEVEL);
break;
}

case WEAPON_DIST: {
attackSkill = getSkill(SKILL_DIST, SKILL_LEVEL);
break;
}

default: {
attackSkill = 0;
break;
}
}
return attackSkill;
}

---------------------------------------------------------------------------------------------------------------------------------------

spells.cpp

if (needWeapon) {
switch (player->getWeaponType()) {
case WEAPON_SWORD:
case WEAPON_CLUB:
case WEAPON_AXE:
case WEAPON_FIST:
break;

---------------------------------------------------------------------------------------------------------------------------------------

tools.cpp

switch (weaponType) {
case WEAPON_SWORD: return "sword";
case WEAPON_CLUB: return "club";
case WEAPON_AXE: return "axe";
case WEAPON_DIST: return "distance";
case WEAPON_WAND: return "wand";
case WEAPON_AMMO: return "ammunition";
case WEAPON_FIST: return "fist";
default: return std::string();

-----------------------------------------------------------------------------------------------------------------------------------

weapons.cpp

if (it.weaponType != WEAPON_NONE) {
switch (it.weaponType) {
case WEAPON_AXE:
case WEAPON_SWORD:
case WEAPON_CLUB:
case WEAPON_FIST:{

-------------------------------------------------------------------------------------------------------------------------------------

still weapons.cpp

WeaponType_t weaponType = item->getWeaponType();
switch (weaponType) {
case WEAPON_SWORD: {
skill = SKILL_SWORD;
return true;
}

case WEAPON_CLUB: {
skill = SKILL_CLUB;
return true;
}

case WEAPON_FIST: {
skill = SKILL_FIST;
return true;
}

case WEAPON_AXE: {
skill = SKILL_AXE;
return true;
}

default:
break;
}
return false;
}
 
Last edited:
Back
Top