Jump to content

Dmgt not working for me for some reason


Playr10

Recommended Posts

    berserk =
    {
        name = "Berserk",
        anim = "slice",
        hit_anim = true,
        icon = "LOSTPASSAGE:textures/shel_card.png",

        desc = "Gains 1 damage per enemy on enemy team. Gain 2 {DEFECT}.\n{STRAIN}, {RESTRAINED}, {EXPEND}",
		manual_desc = true,

        rarity = CARD_RARITY.BASIC,
        cost = 2,
        flags = CARD_FLAGS.MELEE | CARD_FLAGS.RESTRAINED | CARD_FLAGS.EXPEND,
		defect = 2,
        min_damage = 1,
        max_damage = 3,
        hit_count = 4,

        OnPostResolve = function( self, battle )
				self.owner:AddCondition( "DEFECT", self.defect )
				local card = Battle.Card( "status_fatigue", self.owner )
				battle:DealCard( card, battle:GetDeck( DECK_TYPE.DISCARDS ) )
        end,
		
		event_handlers =
        {
            [ BATTLE_EVENT.CALC_DAMAGE ] = function( self, card, target, dmgt )
                if self == card then
					local damage_amount = self.owner.team:GetEnemyTeam():NumActiveFighters()
					dmgt:AddDamage( damage_amount, damage_amount, self)
					print(self.owner.team:GetEnemyTeam():NumActiveFighters())
                end
            end,
        },      
    },

This code doesn't crash, but it also doesn't raise the damage. I used print, and the numbers were returning just fine.

Link to comment
Share on other sites

since I've already made this topic, why does this code appear to counteract Power from raising the damage maximum, but not the minimum?
 

		event_handlers =
        {
            [ BATTLE_EVENT.CALC_DAMAGE ] = function( self, card, target, dmgt )
                if self == card then
					local damage_amount = self.owner.team:GetEnemyTeam():NumActiveFighters()
					dmgt:AddDamage( damage_amount, damage_amount, self)
					print(self.owner.team:GetEnemyTeam():NumActiveFighters())
					dmgt:ModifyDamage( dmgt.min_damage - self.owner:GetConditionStacks("POWER"), dmgt.max_damage - self.owner:GetConditionStacks("POWER"), self )
                end
            end,
        },     

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...