protected virtual void Hit(Unit unit, AttackProperties property) { status.hp -= property.damage + (property.damage * (unit.status.bustmodstate == 2 ? 0.1f : 0f)); GameManager.Instance.SetFillAmount(transform.tag + "Hp", status.hp / 100f); if (status.hp < 30f) { BustMod(true); } GameManager.Instance.CreateHitParticle(transform.position); Vector2 knockback = property.hitProperties.knockback; knockback.x = knockback.x * (Attack.isRight ? -1f : 1f); transform.rotation = Quaternion.Euler(transform.eulerAngles.x, (unit.Attack.isRight ? 0f : 180f), transform.eulerAngles.z); Rigid.velocity = knockback; if (property.hitProperties.stun) { StartCoroutine(StunDelay(property.hitProperties.stuntime)); } else { StartCoroutine(HitDelay(property.hitProperties.hitdelay)); } }
public void AttackColliderActive(AttackProperties proerties) { if (isactive) { Debug.LogError("Collider is already Actived"); return; } if (activecollidername == proerties.name) { return; } for (int i = 0; i < colliders.Length; i++) { if (colliders[i].Name == proerties.name) { activecollidername = proerties.name; StartCoroutine(ColliderActive(colliders[i], proerties.fdelay, proerties.delay, proerties.during, proerties.times, proerties.damage)); return; } } Debug.LogError("Collider is not Actived (collider is not founded)"); }
public void ReceiveAttackFeedback(AttackProperties attack, bool blocked) { if (!blocked) { playerState.LogAttackEvent(attack); } }
private void SetOutputAttackProperties(AttackProperties attackProperty) { outputDamage = attackProperty.damage; outputHitStun = attackProperty.hitStun; outputBlockStun = attackProperty.blockStun; outputPushBack = attackProperty.pushBack; outputBlockType = attackProperty.blockType; }
public int PP(int startingPP) { AttackProperties attackprop = new AttackProperties(); attackprop.AttackPP = startingPP; //This is will be used for the permanent max //currentPP for the attack's pp left return(attackprop.AttackPP); }
public static AttackProperties ReadFrom(System.IO.BinaryReader reader) { var result = new AttackProperties(); result.AttackRange = reader.ReadInt32(); result.Damage = reader.ReadInt32(); result.CollectResource = reader.ReadBoolean(); return(result); }
public static AttackProperties ReadFrom(System.IO.BinaryReader reader) { int attackRange = reader.ReadInt32(); int damage = reader.ReadInt32(); bool collectResource = reader.ReadBoolean(); var result = new AttackProperties(attackRange, damage, collectResource); return(result); }
public void ApplyAttack(AttackProperties attack, Transform instigator) { Vector3 attackDir = user.transform.position - instigator.position; attackDir.y = 0; Debug.LogWarning ("Attack has landed! Should deal "+attack.AdjustedDamageValue+" damage and "+attack.AdjustedImpactValue+" stun."); //Apply attack damage ApplyVitalUse (attack.AdjustedDamageValue, charStats.Health); //Apply attack stun ApplyHitStun (attack.AdjustedImpactValue, attackDir); }
public MainWindowViewModel() { _connProperties = new ConnectionProperties(); _attackProperties = new AttackProperties(); _connectionService = new ConnectionService(); //ONLY FOR TEST - DEVELOPMENT attackProperties.QueryText = @"SELECT @@VERSION"; connProperties.ServerName = @"MARCIN\SQLEXPRESS"; connProperties.DatabaseName = "CS"; connProperties.User = "******"; connProperties.Password = "******"; ExecuteCommand = new CommandHandler(Execute, () => true); CreateConnectionStringCommand = new CommandHandler(ConnectToDatabase, () => true); DisconnectAndResetCommand = new CommandHandler(DisconnectAndReset, () => true); }
protected virtual IEnumerator DoAttack(AttackProperties attackProperties) { WaitForSeconds hitTime = new WaitForSeconds(attackProperties.hitTime); WaitForEndOfFrame endOfFrame = new WaitForEndOfFrame(); RaycastHit raycastHit; isAttacking = true; delayTimer = Time.time; currentDelay = attackProperties.delay; yield return(endOfFrame); weaponAnimator.SetAttack(-1); yield return(hitTime); if (Physics.Raycast(attackPoint.position, attackPoint.forward, out raycastHit, attackProperties.range)) { Debug.Log(raycastHit.transform.name); if (decalProperties != null) { DecalProperty decalProperty = DecalHelper.GetDecalPropertyBySurface(decalProperties, raycastHit); GameObject decal = decalProperty.GetRandomDecal(); AudioClip decalSoundEffect = decalProperty.GetRandomSound(); if (decal != null) { PoolManager.Instantiate(decal, raycastHit.point, Quaternion.LookRotation(raycastHit.normal)); } if (decalSoundEffect != null) { audioSource.PlayOneShot(decalSoundEffect); } } Rigidbody rigidbody = raycastHit.transform.GetComponent <Rigidbody>(); if (rigidbody != null) { rigidbody.AddForceAtPosition(attackPoint.forward * attackProperties.impulse, raycastHit.point); } } }
public void ReceiveAttack(HitCollider hitCollider, AttackProperties attack) { bool blocked = false; Moves nextMove = Moves.None; switch (playerState.CheckBlocking(attack.angle)) { case true: nextMove = Moves.Blocking; blocked = true; break; case false: nextMove = Moves.BeingHit; blocked = false; playerHealth.TakeDamage(attack.damage); particle.Play(); break; } playerState.SetStateTimer(nextMove, attack.hitStun, attack.blockStun, attack.angle); hitCollider.ReceiveAttackFeedback(attack, blocked); }
public virtual void BulletHit(Unit unit, BulletAttackReport bullet) { AttackProperties property = GameManager.Instance.GetAttackProperties(unit.tag, bullet.name); Hit(unit, property); }
public void SetAttackProperties(AttackProperties normalAttack, AttackProperties specialAttack) { this.normalAttack = normalAttack; this.specialAttack = specialAttack; }
public virtual void Hit(Unit unit) { AttackProperties property = GameManager.Instance.GetAttackProperties(unit.tag, unit.ColliderCtrl.ActiveColliderName); Hit(unit, property); }
public void SetNormalAttackProperties(AttackProperties value) { normalAttack = value; }
public void SetSpecialAttackProperties(AttackProperties value) { specialAttack = value; }
public Attack(AttackProperties properties, GameObject[] targets) { this.properties = properties; this.targets = targets; RollHits(); }
public void LogAttackEvent(AttackProperties attack) { PlayerAttacked(this, new EvolutionEventArgs(attack)); }
public EvolutionEventArgs(AttackProperties attack) { attackProperties = attack; }
public Hit(AttackProperties properties, GameObject target) { this.properties = properties; this.target = target; DeliverHit(); }
public EvolutionEventArgs(Moves move, AttackProperties attack) { loggedMoved = move; attackProperties = attack; }