public override void Abillity3(Level level) { if (Keyboard.GetState().IsKeyDown(Keys.D3) && pastKey3.IsKeyUp(Keys.D3)) { if (Global.hardMode && Level < Ability3LevelReq) { pastKey3 = Keyboard.GetState(); Global.Gui.WriteToConsole("You need level " + Ability3LevelReq + " to use that ability"); return; } if (CurrentResource >= ProjectileAttack.ManaCost) { MouseState mouse = Mouse.GetState(); Vector2 tempVector = new Vector2(mouse.X, mouse.Y); Vector2 mousePos = Global.Camera.ScreenToWorld(tempVector); ProjectileAttack.Use(this, mousePos); CurrentResource -= ProjectileAttack.ManaCost; Global.SoundManager.warriorAbillity3.Play(); } else { Global.Gui.WriteToConsole("Not enough mana"); } } pastKey3 = Keyboard.GetState(); }
public override void BasicAttack(Level level) { if (Mouse.GetState().LeftButton == ButtonState.Pressed)// && pastButton.LeftButton == ButtonState.Released) { if (actionTimer > timeBetweenActions) { if (CurrentResource >= ProjectileAttack.ManaCost) { MouseState mouse = Mouse.GetState(); Vector2 tempVector = new Vector2(mouse.X, mouse.Y); Vector2 mousePos = Global.Camera.ScreenToWorld(tempVector); ProjectileAttack.Use(this, mousePos); CurrentResource -= ProjectileAttack.ManaCost; actionTimer = 0; Global.SoundManager.mageBasicAttack.Play(); } else { Global.Gui.WriteToConsole("Not enough mana"); } } else { Global.Gui.WriteToConsole("Cant attack yet"); } } //pastButton = Mouse.GetState(); }
override protected void upgradeOtherAbility(Ability other) { if (other.GetType().BaseType == typeof(ProjectileAttack)) { ProjectileAttack pa = (ProjectileAttack)other; pa.onCollision = upgradeSpray; } else if (other.GetType().BaseType == typeof(CloseBlast)) { CloseBlast cb = (CloseBlast)other; cb.onHitByBurst = upgradeSpray; } else if (other.GetType().BaseType == typeof(Buff)) { Buff b = (Buff)other; onCollision = b.buffEffect; b.activeFunc = activeEffect; } else if (other.GetType().BaseType == typeof(Special)) { if (other.GetType() == typeof(Dash)) { Dash d = (Dash)other; d.preDashAction = sprayClusters; } else if (other.GetType() == typeof(OrbGenerator)) { OrbGenerator og = (OrbGenerator)other; og.onCollision = upgradeSpray; } } }
IEnumerator CR_TowerActive() { while (true) { this.detectionTimer -= Time.deltaTime; this.fireTimer -= Time.deltaTime; if (this.detectionTimer <= 0) { this.currentTarget = AcquireTarget(); this.detectionTimer = DETECTION_INTERVAL; } if (this.fireTimer <= 0) { if (this.currentTarget != null) { ProjectileAttack newAttack = Instantiate <ProjectileAttack>(this.attack, this.transform.position, Quaternion.identity); newAttack.DoAttack(this.currentTarget); this.fireTimer = 1f / this.fireRate; } } yield return(new WaitForEndOfFrame()); } }
override protected void upgradeOtherAbility(Ability other) { if (other.GetType().BaseType == typeof(ProjectileAttack)) { ProjectileAttack pa = (ProjectileAttack)other; pa.bulletVelocity += speedScaling * effectSize; } else if (other.GetType().BaseType == typeof(CloseBlast)) { CloseBlast cb = (CloseBlast)other; cb.onHitByBurst = knockback; } else if (other.GetType().BaseType == typeof(Buff)) { Buff b = (Buff)other; b.effectSize += effectSize / 5; } else if (other.GetType().BaseType == typeof(Special)) { if (other.GetType() == typeof(ClusterShower)) { ClusterShower cs = (ClusterShower)other; cs.onCollision = knockback; } else if (other.GetType() == typeof(OrbGenerator)) { OrbGenerator og = (OrbGenerator)other; og.IncreaseOrbSpeed(effectSize); } } }
protected override void upgradeOtherAbility(Ability other) { if (other.GetType().BaseType == typeof(ProjectileAttack)) { ProjectileAttack pa = (ProjectileAttack)other; pa.onCollision = defaultCollision; } else if (other.GetType().BaseType == typeof(CloseBlast)) { CloseBlast cb = (CloseBlast)other; cb.onHitByBurst = defaultCollision; } else if (other.GetType().BaseType == typeof(Buff)) { Buff b = (Buff)other; b.effectSize += effectSize / 5; } else if (other.GetType().BaseType == typeof(Special)) { if (other.GetType() == typeof(ClusterShower)) { ClusterShower cs = (ClusterShower)other; cs.onCollision = defaultCollision; } else if (other.GetType() == typeof(Dash)) { Dash d = (Dash)other; d.preDashAction = activeEffect; } } }
public PlayerShoot(playerControl p) { player = p; playerBody = p.GetComponent <Rigidbody>(); projectile = p.projectile.gameObject; projAtk = projectile.GetComponent <ProjectileAttack>(); input = p.input; }
public void MoveFowardTo(Vector3 direction) { if (status.GetCurrentState() == Status.StateType.Move) { return; } GameManager.Instance.AddSwipeCount(); if (weapon.WeaponType == Weapon.WeaponTypes.Bow) { RaycastHit hit; //화살 발사 방향으로 몬스터 확인 Ray bowRay = new Ray(transform.position, -direction); if (Physics.Raycast(bowRay, out hit, 6f)) { if (hit.collider.gameObject.CompareTag(Defines.Tag_Monster)) { lookDirection = -direction; ShowEffect("AttackEffect/" + weapon.AttackEffect, transform.position, ConverLookDirectionToRotation()); SoundManager.Instance.PlaySFX(weapon.UseSfx); ProjectileAttack attack = Instantiate(Resources.Load <GameObject>("Effect/Bow_Projectile")).GetComponent <ProjectileAttack>(); attack.transform.position = transform.position + lookDirection; attack.Shot(lookDirection, status.AttackPower); transform.Find("MainChar").rotation = Quaternion.LookRotation(lookDirection); --weaponCount; if (weaponCount <= 0) { ChangeWeapon(defaultWeapon); } else { GameManager.Instance.gameUI.ShowWeaponCount(weaponCount); } return; } } } lookDirection = direction; Vector3 destination = SearchPath(transform.position, direction); transform.Find("MainChar").rotation = Quaternion.LookRotation(direction); MoveTo(destination); }
override protected void upgradeOtherAbility(Ability other) { print(abilityName + " upgrading " + other.abilityName); if (other.GetType().BaseType == typeof(ProjectileAttack)) { ProjectileAttack pa = (ProjectileAttack)other; effectSize = -effectSize; pa.onCollision = doBuff; } else if (other.GetType().BaseType == typeof(CloseBlast)) { CloseBlast cb = (CloseBlast)other; effectSize = -effectSize; cb.onHitByBurst = doBuff; } else if (other.GetType().BaseType == typeof(Buff)) { Buff b = (Buff)other; b.buffs.Add(buffEffect, undoBuff); b.buffDurations.Add(buffEffect, buffDuration); } else if (other.GetType().BaseType == typeof(Special)) { if (other.GetType() == typeof(Dash)) { Dash d = (Dash)other; d.preDashAction = activeEffect; } else if (other.GetType() == typeof(ClusterShower)) { ClusterShower cs = (ClusterShower)other; effectSize = -effectSize; cs.onCollision = doBuff; } else if (other.GetType() == typeof(OrbGenerator)) { OrbGenerator og = (OrbGenerator)other; effectSize -= effectSize; og.onCollision = doBuff; } } }
override protected void upgradeOtherAbility(Ability other) { print(abilityName + " upgrading " + other.abilityName); if (other.GetType().BaseType == typeof(ProjectileAttack)) { ProjectileAttack pa = (ProjectileAttack)other; pa.onCollision = createBlastFromProjCollision; pa.onCollisionTargets = burstTargets; } else if (other.GetType().BaseType == typeof(CloseBlast)) { CloseBlast cb = (CloseBlast)other; cb.onHitByBurst = onHitByBurst; cb.burstTargets = burstTargets; } else if (other.GetType().BaseType == typeof(Buff)) { Buff b = (Buff)other; onHitByBurst = b.buffEffect; b.activeFunc = activeEffect; } else if (other.GetType().BaseType == typeof(Special)) { if (other.GetType() == typeof(Dash)) { Dash d = (Dash)other; d.preDashAction = activeEffect; } else if (other.GetType() == typeof(ClusterShower)) { ClusterShower cs = (ClusterShower)other; cs.onCollision = createBlast; cs.onCollisionTargets = burstTargets; } else if (other.GetType() == typeof(OrbGenerator)) { OrbGenerator og = (OrbGenerator)other; og.onCollision = createBlast; og.onCollisionTargets = burstTargets; } } }
protected override void LoadSkills() { skill1 = new ProjectileAttack("Sprites/Menu/Skills/spr_skill_6", "Sprites/Items/Projectiles/spr_ice_", 8, "Sprites/Items/Particles/spr_ice_explosion@4"); skill2 = new ProjectileAttack("Sprites/Menu/Skills/spr_skill_7", "Sprites/Items/Projectiles/spr_fire_", 8, "Sprites/Items/Particles/spr_fire_explosion@3x4", 1.5f, 12, MouseButton.Right); skill3 = new BlockHold("Sprites/Menu/Skills/spr_skill_8", "Sprites/Items/Particles/spr_shield@4"); }
protected override void LoadSkills() { skill1 = new ProjectileAttack("Sprites/Menu/Skills/spr_skill_9", 1, "Sprites/Items/Projectiles/spr_rock", 1, "Sprites/Items/Particles/spr_rock_explosion@4", 1, 5); skill2 = new SpeedBuff("Sprites/Menu/Skills/spr_skill_2", 2, "Sprites/Items/Particles/spr_stamina@4"); skill3 = new AreaHeal("Sprites/Menu/Skills/spr_skill_1", 3, "Sprites/Items/Particles/spr_heal@6"); }
void upgradeProjectileAttack(ProjectileAttack pa) { pa.onCollision = burstEffect; }
void upgradeProjectileAttack(ProjectileAttack pa) { pa.onCollision = burstEffect; }
// Start is called before the first frame update void Start() { collider_filter = collider_filter.NoFilter(); double_parent = transform.parent.transform.parent.gameObject; weapon_attack = double_parent.GetComponent <ProjectileAttack>(); }
protected override void Start() { base.Start(); projectileAttack = GetComponentInChildren <ProjectileAttack>(); }