void Start() { EffectsModule = GetComponent <SpellInstance>().spellCaster.GetComponent <EffectsModule>(); AttackModule = EffectsModule.gameObject.GetComponent <AttackModule>(); AttackModule.OnAttackEnd += LoseBoost; EffectsModule.ApplyTemporaryEffect(Effect); }
AttackModule CreateAttackModule(AICharacterData data) { var attackModule = new AttackModule(); attackModule.minDamage = data.minDamage; attackModule.maxDamage = data.maxDamage; return(attackModule); }
// Use this for initialization void Start() { attackModule = transform.parent.GetComponent <AttackModule> (); if (attackModule == null) { Debug.LogError("RangeBounds: an AttackModule needs to be attached to the parent of the object containing RangeBounds!"); } }
AttackModule CreateAttackModule(BasePlayerCharacterStats baseStats) { var attackModule = new AttackModule(); attackModule.minDamage = baseStats.baseMinMeleeDamage; attackModule.maxDamage = baseStats.baseMaxMeleeDamage; return(attackModule); }
protected void SetSkills() { attackModules = new AttackModule[skillIDs.Length]; for (int i = 0; i < attackModules.Length; ++i) { attackModules[i] = new AttackModule(this); attackModules[i].SetSkill(skillIDs[i]); } }
public void Init(MainSystem parent) { mainSystem = parent; attackModule = new AttackModule(); surviveModule = new SurviveModule(); attackModule.Init(mainSystem); surviveModule.Init(mainSystem); }
//[HideInInspector] public NavMeshAgent NavMeshAgent; void Awake() { attackModule = GetComponent <AttackModule> (); chaseState = new ChaseState(this); alertState = new AlertState(this); patrolState = new PatrolState(this); attackState = new AttackState(this); //navMeshAgent = GetComponent<NavMeshAgent> (); }
public Skeleton( string id, string name, int healthPoints, IDamage damage, IArmor armor, IPassiveSkill passiveSkill) : base(id, name, healthPoints, damage) { AttackHandlers.Add(passiveSkill); AttackModule.AddAttackProducer(passiveSkill); ArmorPoints = armor.ArmorPoints; PassiveSkill = passiveSkill; }
//private DoneHashIDs hashIDs; void Awake() { animator = GetComponentInChildren <Animator> (); animatorSetup = new AnimatorSetup(animator); attackModule = GetComponent <AttackModule> (); //hashIDs = new DoneHashIDs(); // animatorSetup = new DoneAnimatorSetup(animator, hashIDs); aiPath = GetComponent <GG_AIPath> (); // Set the weights for the shooting and gun layers to 1. animator.SetLayerWeight(1, 1f); animator.SetLayerWeight(2, 1f); deadZone *= Mathf.Deg2Rad; //NavAnimSetup(); }
private void Start() { MovementModule = GetComponent <MovementModule>(); MovementModule.OnMove += Walking; MovementModule.OnStill += Idle; MovementModule.OnDodge += Dodge; SpellCaster = GetComponent <SpellCaster_Struggler>(); SpellCaster.OnTriggerCastTargetAnimation += CastTargetSpell; AttackModule = GetComponent <AttackModule>(); AttackModule.OnAttack += Attack; HealthController = GetComponent <HealthController>(); HealthController.OnDie += TriggerDie; Rigidbody = GetComponent <Rigidbody>(); }
protected override void Execute() { TilePosition s = this.Source.PositionAs <TilePosition>(); TilePosition e = Target.PositionAs <TilePosition>(); AttackModule attmod = this.Source.Module <AttackModule>(); Vector v = new Vector(s.Point, e.Point); float dist = v.Distance; float attackrange = (int)attmod.AttackRange; if (!attmod.CanReachPoint(s.Point, e.Point)) { return; } int dmg = attmod.Damage; this.DamageOnResolve = dmg; int attackTime = attmod.AttackTime; this.Source.Raise(new UnitBeginAttackEvent(Source, Target, dmg, attackTime)); Action attackfun = delegate { this.RunAction(this.Source, new DealDamageToUnitAction(Target, dmg)); }; if (attackTime > 0) { var timerAction = this.Factory.CreateTimer(attackfun); timerAction.SetSingle(attackTime); this.RunAction(timerAction); } else { attackfun(); } }
//Will be refactored soon.. //private ControllableComponent selectableComponent; public new void Start() { //Prioritize the walking animation //anim["forward"].layer = 10; //Play all animations // anim.Play("awake"); // anim.Play("forward"); //Setup awake animations properties // anim["awake"].wrapMode = WrapMode.Clamp; // anim["awake"].speed = 0; // anim["awake"].normalizedTime = 1F; //Call Start in base script (AIPath) healthScaler = GetComponentInChildren <HealthScaler>(true); attackModule = GetComponent <AttackModule> (); animationComponent = GetComponentInChildren <GG_Animation> (); //healthStatus.OnHealthZero += OnHealthZero; //selectableComponent = GetComponent<ControllableComponent> (); base.Start(); }