Exemplo n.º 1
0
        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;
            });
        }
Exemplo n.º 2
0
        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();
 }
Exemplo n.º 4
0
    // 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);
            }
        }
    }
Exemplo n.º 5
0
        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();
            }
        }
Exemplo n.º 6
0
        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;
                    }
                }
            };
        }