Jump to content

Found dragonfly bug in scripts


Recommended Posts

data/scripts/prefabs/dragonfly.lua

local function TransformNormal(inst)

    inst.AnimState:SetBuild("dragonfly_build")
    inst.enraged = false
    --Set normal stats
    inst.components.locomotor.walkspeed = TUNING.DRAGONFLY_SPEED
    inst.components.combat:SetDefaultDamage(TUNING.DRAGONFLY_DAMAGE)
    inst.components.combat:SetAttackPeriod(TUNING.DRAGONFLY_ATTACK_PERIOD)
    inst.components.combat:SetRange(TUNING.DRAGONFLY_ATTACK_RANGE, TUNING.DRAGONFLY_FIRE_HIT_RANGE)
 
    UpdateFreezeThreshold(inst)
 
    inst.components.propagator:StopSpreading()
    inst.Light:Enable(false)
end
 
local function TransformFire(inst)
 
    inst.AnimState:SetBuild("dragonfly_fire_build")
    inst.enraged = true
    inst.can_ground_pound = true
    --Set fire stats
    inst.components.locomotor.walkspeed = TUNING.DRAGONFLY_FIRE_SPEED
    inst.components.combat:SetDefaultDamage(TUNING.DRAGONFLY_FIRE_DAMAGE)
    inst.components.combat:SetAttackPeriod(TUNING.DRAGONFLY_FIRE_ATTACK_PERIOD)
    inst.components.combat:SetRange(TUNING.DRAGONFLY_ATTACK_RANGE, TUNING.DRAGONFLY_HIT_RANGE)
 
    inst.Light:Enable(true)
    inst.components.propagator:StartSpreading()
 
    inst.components.moisture:DoDelta(-inst.components.moisture:GetMoisture())
 
    UpdateFreezeThreshold(inst)
 
    if inst.reverttask then
        inst.reverttask:Cancel()
        inst.reverttask = nil
    end
 
    inst.reverttask = inst:DoTaskInTime(TUNING.DRAGONFLY_ENRAGE_DURATION, 
        function() if inst.enraged then 
            inst:PushEvent("transform", {transformstate = "normal"})
        end end)
end

Pay attention to these lines

inst.components.combat:SetRange(TUNING.DRAGONFLY_ATTACK_RANGE, TUNING.DRAGONFLY_FIRE_HIT_RANGE)

inst.components.combat:SetRange(TUNING.DRAGONFLY_ATTACK_RANGE, TUNING.DRAGONFLY_HIT_RANGE)

They are swapped.

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...