public void init(Unit _host, Collider _self, PotentialTarget _tgt = PotentialTarget.ANY, Decision _dec = Decision.IDEL) { ThinkTimer = new Utility.Timer(thinkPeriod); ThinkTimer.start_timer(); self = _self; unit = _host; _host.AI_unit = this; target = _tgt; decision = _dec; vision = GetComponent <CapsuleCollider> (); objWithin_Ally_champ = new List <GameObject>(); objWithin_Ally_minion = new List <GameObject>(); objWithin_Ally_struct = new List <GameObject>(); objWithin_Ally_item = new List <GameObject>(); objWithin_Hostile_champ = new List <GameObject>(); objWithin_Hostile_minion = new List <GameObject>(); objWithin_Hostile_struct = new List <GameObject>(); objWithin_Hostile_item = new List <GameObject>(); objWithin_neturals = new List <GameObject> (); listedby = new List <GameObject> (); temp_untargetable = new List <GameObject> (); init_special(); }
} //like Garen's W, or Nasus's Q public override void process_death() { base.process_death(); death_timer.start_timer(); navagent.Stop(); navagent.enabled = false; }
public void init_post_tower() { runtime_u_stats = base_u_stats; update_attack_speed(); autoAtkTimer = new Utility.Timer(runtime_u_stats.attack_speed); autoAtkTimer.start_timer(); init_AtkTarget(); init_resources(); }
public void init(float time) { depend_on_pos = false; isnot_default = true; name = "default status name"; flags = ""; dur = time; timer = new Utility.Timer(dur); timer.start_timer(); }
public void init(Collider slf, float radius, bool continuous, Types.damage_combo dmg, Types.damage_combo start_dmg, Types.damage_combo end_dmg, float dur = 0, int times_of_dmg = 0, //paras for continuous damage bool crit = false, float single_tgt_bonus = 0, //if only one target in there, any additional damage? bool champ = true, bool minion = true, bool neturals = true, Utility.Timer share_dur = null, Utility.Timer share_dmg = null, Status enter_sts = default(Status), Status end_sts = default(Status)) { self = slf; duration = dur; damage = dmg; start_damage = start_dmg; end_damage = end_dmg; max_damage_times = times_of_dmg; done_damage_times = 0; can_crit = crit; single_target_bonus = single_tgt_bonus; enter_status = enter_sts; end_status = end_sts; affect_champions = champ; affect_minions = minion; affect_neturals = neturals; is_continuous = continuous; if (is_continuous) { if (share_dur == null) { sharing_dur = false; dur_timer = new Utility.Timer(dur); dur_timer.start_timer(); } else { sharing_dur = true; dur_timer = share_dur; } if (share_dmg == null) { sharing_dmg = false; dmg_timer = new Utility.Timer((float)(duration / max_damage_times)); dmg_timer.start_timer(); } else { sharing_dmg = true; dmg_timer = share_dmg; } } clder = GetComponent <CapsuleCollider> (); clder.radius = radius * GameSceneConsts.dist_multiplier; }
public void init_post() { runtime_u_stats = base_u_stats; update_attack_speed(); //update_movement_speed ();//called from outside autoAtkTimer = new Utility.Timer(runtime_u_stats.attack_speed); autoAtkTimer.start_timer(); init_AtkTarget(); init_resources(); //netUnit = transform.parent.GetComponent<NetworkUnit>(); //netUnit.init(runtime_u_stats.max_hp, runtime_u_stats.max_mana); }
void init(Types.Lanes _lane = Types.Lanes.OTHER, Types.Faction _fac = Types.Faction.OTHER) { //fac = _fac; //lane = _lane; type = WaveType.NORMAL; wave_active = false; timer_wave = new Utility.Timer(GameSceneConsts.minion_wave_interval); timer_wave.finish(); timer_micro = new Utility.Timer(GameSceneConsts.minion_spawn_interval); timer_wave.start_timer(); timer_micro.start_timer(); //load Resources minion_prefab = Resources.Load("Prefabs/Minions/minion_test") as GameObject; }
//call this before actual init(); public void init_pre() { netID = transform.parent.gameObject.GetComponent <NetworkIdentity> (); self_col = GetComponent <Collider> (); cur_target_obj = null; status = new List <Status> (); flags = new unit_flags(); flags.init(); if ((!netID.isLocalPlayer) && (isPlayer)) { return; } //stats base_u_stats = new unit_stats(); base_u_stats.init(); base_u_stats_mult = new unit_stats(); base_u_stats_mult.init_to_1(); u_stats_growth = new unit_stats(); u_stats_growth.init(); bonus_u_stats = new unit_stats(); bonus_u_stats.init(); bonus_u_stats_mult = new unit_stats(); bonus_u_stats_mult.init_to_1(); inCombat_timer = new Utility.Timer(GameSceneConsts.in_combat_time); regen_timer = new Utility.Timer(GameSceneConsts.regen_interval); regen_timer.start_timer(); items = new Item[GameSceneConsts.max_item + GameSceneConsts.max_supp_item]; for (int i = 0; i < items.Length; ++i) { items [i] = null; } Onhit_dmg = new Types.damage_combo(); Onhit_dmg.init(); recent_dmg_receive = new Types.damage_combo(); recent_dmg_receive.init(); }