public override void OnApply(ActorStatus status) { if(damageDone){ return; } damageDone = true; if(status.ReadStatus.HP <= 0f) return; if(GetComponent<NetSyncObj>().mode == SFSNetworkManager.Mode.LOCAL){ status.WriteStatus().BaseHP -= damage; float pHp = status.WriteStatus().BaseHP; //pHp -= damage; //Debug.Log ("HP:" + status.WriteStatus().BaseHP); if(pHp < 0) pHp = 0; } else{ Debug.Log ("Remote damage fx"); } //if(status.GetModifiedStatusf(ActorStatus.StatusType.HP) <= 0f){ if(applyForceOnDeath){ ragdollTurner.ReadyExplosion(explosionPosition, explosionForce, explosionRadius); } else{ ragdollTurner.UnreadyExplosion(); } //} animator.SetBool("Hit", true); animationDone = true; }
public override void OnApply(ActorStatus status) { // Debug.Log ("OnApply"); status.WriteStatus().MoveSpeedModifiers[0] += plusModifier1; status.WriteStatus().MoveSpeedModifiers[1] *= mulModifier2; status.WriteStatus().MoveSpeedModifiers[2] += plusModifier3; status.WriteStatus().MoveSpeedModifiers[3] *= mulModifier4; // Debug.Log (status.GetModifiers(ActorStatus.StatusType.MOVESPEED)[1]); }
public override void OnApply(ActorStatus status) { float hp = status.ReadStatus.HP; if(GetComponent<NetSyncObj>().mode == SFSNetworkManager.Mode.LOCAL){ if(hp <= 0f && !startDeathTimer){ startDeathTimer = true; } if(hp > 0f && startDeathTimer){ startDeathTimer = false; deathTimer = 0f; } if(revive){ revive = false; status.WriteStatus().BaseHP = 1; ragdollTurner.UnturnRagdoll(); } } else{ if(lastFrameHP <= 0 && hp > 0){ Debug.Log ("unturn ragdoll"); ragdollTurner.UnturnRagdoll(); } } }
public override void OnApply(ActorStatus status) { status.WriteStatus().SetMotionModifier(0, motion); Debug.Log ("apply motion: " + motion); }