public void fireMask() { LineProjectile proj = new LineProjectile(this, position, position + fourWayDirection() * LIGHTRANGE, LIGHTDAMAGE, LIGHTSPEED); proj.setTexture(new AnimatedTexture(BASETEX + "glass-hat")); proj.modifiers.Add(delegate(Projectile p, GameTime gameTime) { p.rotation += .003f * gameTime.ElapsedGameTime.Milliseconds; }); }
private IEnumerator Fire(Entity caster, Line line) { Locator.Scheduler.Lock(); GameObject tossFXObj = Object.Instantiate( Assets.TossFXPrefab, caster.Cell.Position.ToVector3(), new Quaternion()); LineProjectile proj = tossFXObj.GetComponent <LineProjectile>(); proj.InitializeToss(caster, Entity, line); proj.Fire(); yield return(delay); Locator.Scheduler.Unlock(); }
private IEnumerator Fire(Line[] lines) { Locator.Scheduler.Lock(); for (int i = 0; i < count; i++) { GameObject tossFXObj = Object.Instantiate( Assets.TossFXPrefab, Entity.Cell.Position.ToVector3(), new Quaternion()); LineProjectile proj = tossFXObj.GetComponent <LineProjectile>(); proj.InitializeToss(Entity, item, lines[i]); proj.Fire(); yield return(new WaitForSeconds(delay)); } Locator.Scheduler.Unlock(); }
// Update is called once per frame void Update() { timer += Time.deltaTime; if (state == 0) { if (timer >= windUpTime) { Transform T = am.source.transform; state++; GameObject proj = GameObject.Instantiate(projectilePrefab, T.position, T.rotation); Physics.IgnoreCollision(proj.GetComponent <Collider>(), am.source.GetComponent <CharacterController>()); LineProjectile lp = proj.GetComponent <LineProjectile>(); if (am.targetLocation.actualTarget == null) { lp.direction = am.targetLocation.direction; } else { lp.direction = (am.targetLocation.actualTarget.position - am.source.transform.position).normalized; } lp.father = transform; lp.StartMoving(); projectiles.Add(proj); } } if (state == 1) { if (timer >= recoveryTime) { state += 1; am.source.canMove = true; } } if (state == 2) { if (projectiles.Count == 0) { Destroy(gameObject); } } }
public override CommandResult Execute() { if (Actor.PlayerControlled(Entity)) { switch (Locator.Player.RequestLine(out List <Cell> line, 7)) { case InputMode.Cancelling: return(CommandResult.Cancelled); case InputMode.Line: return(CommandResult.InProgress); case InputMode.Default: { if (item.InInventory) { Entity.GetComponent <Inventory>().RemoveItem(item); } // Line has come through GameObject tossFXObj = Object.Instantiate( Assets.TossFXPrefab, Entity.Cell.Position.ToVector3(), new Quaternion()); LineProjectile proj = tossFXObj.GetComponent <LineProjectile>(); proj.InitializeToss(Entity, item, line); proj.Fire(); return(CommandResult.Succeeded); } default: throw new Exception("Illegal InputMode returned."); } } else { throw new NotImplementedException(); } }
public void startVampBuff() { LineProjectile proj = new LineProjectile(this, position, position + fourWayDirection() * LIGHTRANGE, 0, LIGHTSPEED); proj.setTexture(new AnimatedTexture(BASETEX + "buffer-vamp")); proj.modifiers.Add(delegate(Projectile p, GameTime gameTime) { p.rotation += .003f * gameTime.ElapsedGameTime.Milliseconds; }); proj.collisions = Projectile.CollisionGroup.Characters; proj.characterAction = delegate(Character c) { c.numVampBats++; c.numVampBats = Math.Min(c.numVampBats, 5); c.vampBatDuration = 0; foreach (Character c2 in Game1.characterManager.liveCharacters) { if (c2 != c) { c2.numVampBats = 0; } } }; }