Thread: Bugfixes
View Single Post
  #12  
Old 10-30-2012, 09:50 PM
camelotcrusade's Avatar
camelotcrusade camelotcrusade is offline
Approved Member
 
Join Date: Apr 2009
Location: San Francisco, CA
Posts: 448
Default

That looks great, thanks for using those colors.

Okay so I hunted for the confused effect but then i realized since it only applies on the world map it might bug out if I used it in combat. So instead I found Stun, that would at least indicate "this unit isn't going to do anything this turn."

Here it is:

Code:
-- ***********************************************
-- * Stun
-- ***********************************************
function effect_stun_attack(target, pause, duration, log_message)
  --local target = Attack.get_target()
  if pause == nil then
    pause = 1
  end
  if target == nil then
    target = Attack.get_target()
  end
  if duration == nil then
    duration = tonumber(Logic.obj_par("effect_stun", "duration"))
  end
  if (Attack.act_ally(target) or Attack.act_enemy(target)) and not Attack.act_feature(target, "boss,pawn") then
    --local duration = tonumber(Attack.get_custom_param("duration"))
    duration = correct_spell_duration (duration, target, true)
    local inbonus = tonumber(Logic.obj_par("effect_stun", "inbonus"))
    local speedbonus = tonumber(Logic.obj_par("effect_stun", "speedbonus"))
--    local speed = Attack.act_get_par(target, "speed")

--    local change_speed = speed - speedbonus

    Attack.act_del_spell(target,"effect_stun")
    Attack.act_apply_spell_begin( target, "effect_stun", duration, false )
      Attack.act_apply_par_spell( "disreload", 10, 0, 0, duration, false)
      Attack.act_apply_par_spell( "disspec", 10, 0, 0, duration, false)
      Attack.act_apply_par_spell( "initiative", -inbonus, 0, 0, duration, false)
      Attack.act_apply_par_spell( "speed", -speedbonus , 0, 0, duration, false)
    Attack.act_apply_spell_end()
    Attack.atom_spawn(target, pause, "effect_stun", 0, true)

    -- log_message = -1 - íåò ëîãà, 0 - ïðèïèñûâàåì ê äàìàãó, 1 - âûâîäèì îòäåëüíîé ñòðîêîé
    if log_message == nil then
      log_message = 0
    end
    if log_message == 0 then
      Attack.act_damage_addlog(target, "add_blog_stun_")
    elseif log_message == 1 then
      if Attack.act_size(target) > 1 then
        Attack.log(pause, "add_blog_stun_2", "targets", blog_side_unit(target, 1))
      else
        Attack.log(pause, "add_blog_stun_1", "target",  blog_side_unit(target, 1))
      end
    end
  end

  return true
end
Any idea where the visual effect is in all that? I don't want the unit to actually be stunned, just look like while they are distracted.
Reply With Quote