コード例 #1
0
    /// <summary>
    /// Takes 2 parameters: List<HealthEntityCombatObject> targets, HealthEntityCombatObject attacker.
    /// </summary>
    /// <param name="parameters"></param>
    /// <returns></returns>
    public override OnPlayResult OnPlay(params object[] parameters)
    {
        List <HealthEntityCombatObject> targets  = parameters[0] as List <HealthEntityCombatObject>;
        HealthEntityCombatObject        attacker = parameters[1] as HealthEntityCombatObject;

        OnPlayResult onPlayResult = new OnPlayResult();

        foreach (var t in targets)
        {
            HealthEntityCombatObject.DamageInfo damageInfo = t.TakeDamage(Instantiate <AbilityStep_Damage>(this), attacker);
            onPlayResult.unshieldedDamage = damageInfo.damageDealt;
        }

        foreach (var t in targets)
        {
            GameObject particlePrefab = particleEffectPrefab;
            if (particleEffectPrefab == null)
            {
                particlePrefab = FindObjectOfType <CombatManager>().particlePrefab;
            }
            GameObject go = Instantiate(particlePrefab, t.transform);
            go.GetComponent <ParticlesEffect>().Init(0);
        }

        return(onPlayResult);
    }
コード例 #2
0
    public override OnPlayResult OnPlay(params object[] parameters)
    {
        OnPlayResult onPlayResult = new OnPlayResult();

        HealthEntity summoned = FindObjectOfType <BattleManager>().SummonOnEnemySide(summonables[Random.Range(0, summonables.Length)]);

        onPlayResult.summonedEntity = summoned;

        return(onPlayResult);
    }
コード例 #3
0
    public override OnPlayResult OnPlay(params object[] parameters)
    {
        List <HealthEntity> targets      = parameters[0] as List <HealthEntity>;
        OnPlayResult        onPlayResult = (OnPlayResult)parameters[1];

        foreach (var t in targets)
        {
            t.TakeHealing(onPlayResult.unshieldedDamage);
        }

        return(default(OnPlayResult));
    }
コード例 #4
0
    public override OnPlayResult OnPlay(params object[] parameters)
    {
        List <HealthEntity> targets = parameters[0] as List <HealthEntity>;

        OnPlayResult onPlayResult = new OnPlayResult();

        if (type == Type.Damage)
        {
            foreach (var t in targets)
            {
                Enemy.DamageInfo damageInfo = t.TakeDamage(amount);
                onPlayResult.unshieldedDamage = damageInfo.damageDealt;
                GameObject go = Instantiate(FindObjectOfType <BattleManager>().particlePrefab);

                if (t is Player)
                {
                    go.transform.SetParent(((Player)t).particleEmitter);
                }
                else
                {
                    go.transform.SetParent(t.transform);
                }

                go.GetComponent <ParticlesEffect>().Init(damageInfo.damageDealt);
                go.transform.localScale    = Vector3.one;
                go.transform.localPosition = new Vector3(0, -20, 0);
            }
        }
        else if (type == Type.Heal)
        {
            foreach (var t in targets)
            {
                t.TakeHealing(amount);
            }
        }
        else if (type == Type.Block)
        {
            foreach (var t in targets)
            {
                t.ModifyArmor(amount);
            }
        }
        else
        {
            foreach (var t in targets)
            {
                ((Player)t).ModifyMana(amount);
            }
        }

        return(onPlayResult);
    }
コード例 #5
0
    public override OnPlayResult OnPlay(params object[] parameters)
    {
        List <HealthEntity> targets = parameters[0] as List <HealthEntity>;

        OnPlayResult onPlayResult = new OnPlayResult();

        foreach (var t in targets)
        {
            t.AfflictWithStatusEffect(statusEffect);
        }

        return(onPlayResult);
    }
コード例 #6
0
    public override OnPlayResult OnPlay(params object[] parameters)
    {
        List <HealthEntity> targets = parameters[0] as List <HealthEntity>;

        OnPlayResult onPlayResult = new OnPlayResult();

        foreach (var t in targets)
        {
            ((Player)t).DrawRandomCard(amount, true);
        }

        return(onPlayResult);
    }
コード例 #7
0
    public override OnPlayResult OnPlay(params object[] parameters)
    {
        List <HealthEntityCombatObject> targets = parameters[0] as List <HealthEntityCombatObject>;

        OnPlayResult onPlayResult = new OnPlayResult();

        foreach (var t in targets)
        {
            ((PlayerCombatObject)t).DrawCards(amount);
        }

        return(onPlayResult);
    }
コード例 #8
0
	public override OnPlayResult OnPlay(params object[] parameters)
	{
		List<HealthEntityCombatObject> targets = parameters[0] as List<HealthEntityCombatObject>;

		OnPlayResult onPlayResult = new OnPlayResult();

		foreach (var t in targets)
		{
			t.InstaKill();
		}

		return onPlayResult;
	}
コード例 #9
0
    public override OnPlayResult OnPlay(params object[] parameters)
    {
        List <HealthEntityCombatObject> targets = parameters[0] as List <HealthEntityCombatObject>;

        OnPlayResult onPlayResult = new OnPlayResult();

        foreach (var t in targets)
        {
            t.AfflictWithStatusEffect(statusEffect, duration);
        }

        onPlayResult.effectApplied = statusEffect;

        return(onPlayResult);
    }
コード例 #10
0
 private void mk_play_event(IntPtr userdata, int err_code, string err_msg)
 {
     if (userdata == this._resultData)
     {
         if (err_code == 0)
         {
             this.Status = EM_PlayStatus.Playing;
         }
         OnPlayResult?.Invoke(err_code, err_msg);
     }
     else if (userdata == this._shutdownData)
     {
         this.Status = EM_PlayStatus.Closed;
         OnShutdown?.Invoke(err_code, err_msg);
     }
 }
コード例 #11
0
    public override OnPlayResult OnPlay(params object[] parameters)
    {
        List <HealthEntityCombatObject> targets = parameters[0] as List <HealthEntityCombatObject>;
        //HealthEntity healer = parameters[1] as HealthEntity;

        OnPlayResult onPlayResult = new OnPlayResult();

        if (type == Type.Health)
        {
            foreach (var t in targets)
            {
                t.TakeHealing(amount);
            }
        }
        else if (type == Type.Block)
        {
            foreach (var t in targets)
            {
                t.ModifyBlock(amount);
            }
        }
        else if (type == Type.Mana)
        {
            foreach (var t in targets)
            {
                if (t is PlayerCombatObject)
                {
                    ((PlayerCombatObject)t).ModifyMana(amount);
                }
            }
        }

        foreach (var t in targets)
        {
            GameObject particlePrefab = particleEffectPrefab;
            if (particleEffectPrefab == null)
            {
                particlePrefab = FindObjectOfType <CombatManager>().particlePrefab;
            }
            GameObject go = Instantiate(particlePrefab, t.transform);
            go.GetComponent <ParticlesEffect>().Init(0);
        }

        return(onPlayResult);
    }
コード例 #12
0
    public override OnPlayResult OnPlay(params object[] parameters)
    {
        List <HealthEntityCombatObject> targets = parameters[0] as List <HealthEntityCombatObject>;
        OnPlayResult onPlayResult = (OnPlayResult)parameters[1];

        foreach (var t in targets)
        {
            t.TakeHealing(onPlayResult.unshieldedDamage);

            GameObject particlePrefab = particleEffectPrefab;
            if (particleEffectPrefab == null)
            {
                particlePrefab = FindObjectOfType <CombatManager>().particlePrefab;
            }

            Instantiate(particlePrefab, t.transform);
        }

        return(default(OnPlayResult));
    }
コード例 #13
0
    public override OnPlayResult OnPlay(params object[] parameters)
    {
        List <HealthEntityCombatObject> targets = parameters[0] as List <HealthEntityCombatObject>;

        OnPlayResult onPlayResult = new OnPlayResult();

        foreach (var t in targets)
        {
            ((PlayerCombatObject)t).Revive();
        }

        foreach (var t in targets)
        {
            GameObject particlePrefab = particleEffectPrefab;
            if (particleEffectPrefab == null)
            {
                particlePrefab = FindObjectOfType <CombatManager>().particlePrefab;
            }
            GameObject go = Instantiate(particlePrefab, t.transform);
            go.GetComponent <ParticlesEffect>().Init(0);
        }

        return(onPlayResult);
    }