mob/npc
Click()
set src in oview(8)
usr.target = src
overlays += icon('misc.dmi',"overlay")
I wanted to incorporate this code in with my attack code, but I'm not sure if the "target" part would override anything in our new code. What this is supposed to do is make it so that you can't attack an enemy you don't have selected.
Oh! And as for "armrn"
armrn = the user's weapon. "arm" means armed. "r" means right, though I don't use left and right arms anymore, I just left the r on there. "n" is name. This is where it would say
armrn = "executioner pistol"
And please see if this is right:
hit(var/mob/attacker as mob, var/damage as num)
var/blocked = attacker.attackrating < target.dodgec
var/unblocked_damage = damage-blocked
. = unblocked_damage
src << "[attacker.name] attacks you. [unblocked_damage] damage dealt!"
health_adjustment(-unblocked_damage, attacker)
We need to check if a target was actually found so that we don't cause errors trying to attack "null". Check the attack code in my last post to see how I did it.
I made weapon_damage equal to 0 when unarmed because we already use strength when calculating damage:
var/damage = strength + weapon_damage
Imagin if we have a mob with strength=5, carrying a weapon with damageb = 2. If we make unarmed weapon_damage equal to the mob's strength, then he'll hit for 5+5 points when unarmed (strength included twice), but only 5+2 points when carrying a weapon. What we want is to include strength once, and give unarmed a value of 0, so that the unarmed player attacks with 5+0.
You're fogetting two things here. The first is that we replaced "wep_equipped.damageb" with the variable "weapon_damage" so that we don't cause runtime errors when unarmed mobs attack. The second thing you've forgotten is that we need to add proficiency back into the list after we've changed it; read that section of my last post to see how I did it.
You still havn't addressed these lines. I don't quite know what you're trying to do with the blocked booleen variable. (Check my last post for more info).
---
To setup proficiency with a weapon, you just need to add an entry for it in the proficiency list:
mob.weapon_skills[weapon_class] = proficiency
or:
weapon_skills["polearm"] = 5
This is what your character creation might look like:
Or, you could do something more complicated, and give them 10 points that they could spread around to all the different types of weapons.
Later on in the game you can use the same basic line to make them proficient with more weapons. Let's say there's a quest they can go on to make them proficient with the all powerfull class of weapons, the "mollusk":