// Start is called before the first frame update void Start() { EventManager.instance.StartListeningToOnDamageEvent(new UnityAction <IAttackHitbox, IDamageable>(SaveDamage)); EventManager.instance.StartListeningToOnDeathEvent(new UnityAction <GameObject>(OnDeath)); statusManager = GetComponent <StatusManager>(); staticSpeedBuff = new RonPassiveBuffStatus(1.5f, this); statusManager.AddStatus(staticSpeedBuff); }
protected override bool CreateAndRegisterStatus(GameObject target) { StatusMovementAffecting newStatus = new StatusMovementAffecting(statusInfo, forceInfo); //Debug.Log(newStatus.statusType + " has been made from " + effectName + " on " + parentAbility.abilityName); activeStatus.Add(newStatus); StatusManager.AddStatus(target, newStatus); return(true); }
protected override bool CreateAndRegisterStatus(GameObject target) { StatusStatAdjustment newStatus = new StatusStatAdjustment(statusInfo, adjInfo); //Debug.Log(newStatus.statusType + " has been made"); activeStatus.Add(newStatus); StatusManager.AddStatus(target, newStatus); return(true); }
public void TestStatusManagerAddStatus() { //arrange bool result = false; IStatusManager statusManager = new StatusManager(_fakeStatusAccessor); // act result = statusManager.AddStatus("TestAddStatus"); // assert Assert.IsTrue(result); }
public void Launch(IAttackHitbox hitbox) { Vector2 launchVector = SmashCalculator.LaunchVector(hitbox, this); IsLaunched = SmashCalculator.Tumble(hitbox, this); if (IsLaunched) { statusManager.AddStatus(launchStatus); } Debug.Log("Launched! " + launchVector); character.Velocity = launchVector; //Release from grab if launched with high enough velocity if (character.GetGrabber() != null && SmashCalculator.GrabRelease(hitbox, this)) { character.GetGrabber().GetComponent <ICharacter>().GrabRelease(); } }
public void OnShieldBreak() { Debug.Log(owner.name + "'s Shield Broken!"); if (IsShieldStunned) { OnShieldStunOver(); } DeactivateShield(); statusManager.AddStatus(shieldBreakStatus); character.IgnoreInput(true); animator.SetTrigger("ShieldBreak"); Vector2 launchVector = new Vector2(0.0f, 6.0f); character.Velocity = launchVector; damageable.SetIntangible(); Freeze(15); }
protected override bool CreateAndRegisterStatus(GameObject target) { StatusStatAdjustment newStatus = new StatusStatAdjustment(statusInfo, adjInfo); //if(interval > 0) //{ // newStatus = new StatusStatAdjustment(statusTypeInfo, adjInfo, duration, interval); //} //else //{ // newStatus = new StatusStatAdjustment(statusTypeInfo, adjInfo, duration); //} activeStatus.Add(newStatus); StatusManager.AddStatus(target, newStatus); return(true); }
public void AddStatus(StatusTemplate status, string key) { status.Key = key; _statusManager.AddStatus(status); }
//Roll Functions public void ForwardRollStart() { movementStatus = new MovementStatus(new Vector2(isFacingRight ? rollSpeed : -rollSpeed, 0), 20); statusManager.AddStatus(movementStatus); }
public override void Apply(GameObject target) { base.Apply(target); //if (!CheckForSpecificTarget(target)) // return; switch (statusType) { case Constants.StatusEffectType.None: //Status newStatus = target.AddComponent<Status>(); Status newStatus = new Status(); newStatus.Initialize(target, duration, interval, statusType, parentAbility); StatusManager.AddStatus(target.GetComponent <Entity>(), newStatus, this, parentAbility); break; case Constants.StatusEffectType.AffectMovement: //AffectMovement newAffectMovement = target.AddComponent<AffectMovement>(); AffectMovement newAffectMovement = new AffectMovement(); //knockbackVector = TargetingUtilities.DegreeToVector2(knocbackAngle); knockbackVector = TargetingUtilities.DirectionFromAngle(knocbackAngle, false); if (Source.Facing == Constants.EntityFacing.Left) { knockbackVector = new Vector2(-knockbackVector.x, knockbackVector.y); } //Debug.Log(knockbackVector + " is the knockback vector"); newAffectMovement.Initialize(target, duration, interval, statusType, parentAbility, maxStack, onCompleteEffect); newAffectMovement.InitializeAffectMovement(affectMoveType, affectMoveValue, knockbackVector); StatusManager.AddStatus(target.GetComponent <Entity>(), newAffectMovement, this, parentAbility); break; case Constants.StatusEffectType.Stun: Stun newStun = new Stun(); newStun.Initialize(target, duration, interval, statusType, parentAbility); newStun.InitializeStun(); StatusManager.AddStatus(target.GetComponent <Entity>(), newStun, this, parentAbility); break; case Constants.StatusEffectType.DamageOverTime: float damage; if (scaleFromBaseDamage) { damage = damagePerInterval + (parentAbility.source.stats.GetStatModifiedValue(StatCollection.BaseStat.BaseStatType.BaseDamage) * percentOfBaseDamage); } else { damage = damagePerInterval; } //DamageOverTime newDot = target.AddComponent<DamageOverTime>(); DamageOverTime newDot = new DamageOverTime(); newDot.Initialize(target, duration, interval, statusType, parentAbility, maxStack); newDot.InitializeDamageOverTime(damage, parentAbility.source); StatusManager.AddStatus(target.GetComponent <Entity>(), newDot, this, parentAbility); Debug.Log("Applying " + damage + " over time"); break; case Constants.StatusEffectType.StaticStatAdjustment: StatCollection.StatModifer modStatic = new StatCollection.StatModifer(statAdjustmentValue, modType); Debug.Log("Stat " + statType + " is being adjusted by " + statAdjustmentValue); StatAdjustmentManager.ApplyTrackedStatMod(Source, target.GetComponent <Entity>(), statType, modStatic); break; case Constants.StatusEffectType.DurationalStatAdjustment: //StatCollection.StatModifer modDur = new StatCollection.StatModifer(statAdjustmentValue, modType); Debug.Log("Setting durational stuff"); DurationalStatChange newDurationalStatChange = new DurationalStatChange(); newDurationalStatChange.Initialize(target, duration, interval, statusType, parentAbility, maxStack); newDurationalStatChange.InitializeDurationalStatChange(statType, modType, statAdjustmentValue); StatusManager.AddStatus(target.GetComponent <Entity>(), newDurationalStatChange, this, parentAbility); break; } }