Jump to content

Recommended Posts

I made a fun character I call Mr. Mashup. He's a combo of several characters. The bottom of his face came from Wilson so he can grow a beard. The top of his head and the hair from the back came from  Wolfgang. The front and side view of his hair came from Wes. His face came from Christoph. His torso, legs and arms came from  IDF Counter-Terrorist. His feet (boots) and hands (gloves) came from Wunk.

The idea started when I contacted _chatnoir, the author of IDF Counter-Terrorist, and asked if I can use his character as a base for my new character. I wanted a character with built in armor (absorption). Is that cheating? 

I'm done putting him together. Now I need to add some code. I want him to have more ranged damage and weak melee. Animsparrow has code for stronger ranged, but I'd like to balance it with a negative to melee. Can someone help me out? Here's the code from Animsparrow:

AddComponentPostInit("combat", function(Combat)
    local OldCalcDamage = Combat.CalcDamage
    Combat.CalcDamage = function(self, target, weapon, ...)
        local old_damage = nil
        if weapon and weapon.components.projectile and self.inst:HasTag("animsparrow") 
        or weapon and weapon.components.weapon and weapon.components.weapon.projectile ~= nil and self.inst:HasTag("animsparrow")then
            old_damage = self.inst.components.combat.damagemultiplier
            self.inst.components.combat.damagemultiplier = 1.5 -- Will deal 51 dmg with his Gun ( 34 dmg with other chars )
        end
        local ret = OldCalcDamage(self, target, weapon, ...)
        if old_damage and self.inst:HasTag("animsparrow") then
            self.inst.components.combat.damagemultiplier = old_damage
        end
        return ret
    end
end)

I'm not a pro modder, so please forgive me if it's there. I just see the "damagemultiplier = 1.5", I don't see anything like "0.75" that would lessen melee.

Thanks in advance.

Edited by quadgamer

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...