コード例 #1
0
    protected virtual void Attack()
    {
        IcicleProjectile newProjectile = projectile.Instance() as IcicleProjectile;

        newProjectile.Position       = GlobalPosition;
        newProjectile.Damage         = 10;
        newProjectile.LinearVelocity = new Vector2((GetNode("/root/World/Player") as Node2D).GlobalPosition - GlobalPosition).Normalized() * 1250;

        GetNode("/root/World").AddChild(newProjectile);
    }
コード例 #2
0
    public override void UseSpell()
    {
        IcicleProjectile newProjectile = projectile.Instance() as IcicleProjectile;

        newProjectile.Position = GlobalPosition;

        if (game.CheckCold() >= 10)
        {
            newProjectile.LinearVelocity = new Vector2(owner.GetForward().Position - Position).Normalized() * (projectileSpeed * 2);
            newProjectile.Damage         = damage * 2;
        }
        else
        {
            newProjectile.LinearVelocity = new Vector2(owner.GetForward().Position - Position).Normalized() * projectileSpeed;
            newProjectile.Damage         = damage;
        }

        GetNode("/root/World").AddChild(newProjectile);

        game.AddCold(5);
    }