Exemplo n.º 1
0
    // 地雷生效的效果
    public override void onEffective(Character player)
    {
        // 通知角色被攻击
        CommandCharacterAttacked cmdAttack = newCmd(out cmdAttack);

        cmdAttack.mAttackSource = mType;
        pushCommand(cmdAttack, player);
        if (player.isType(CHARACTER_TYPE.CT_MYSELF))
        {
            GameTools.PLAY_AUDIO_OBJECT(this, SOUND_DEFINE.SD_LANDMINE_EXPLODE);
        }
        // 开始销毁地雷
        mItemManager.destroyItem(this);
    }
Exemplo n.º 2
0
    public override void onEffective(Character player)
    {
        // 通知角色被攻击
        CommandCharacterAttacked cmdAttack = newCmd(out cmdAttack);

        cmdAttack.mAttackSource = mType;
        pushCommand(cmdAttack, player);
        if (player.isType(CHARACTER_TYPE.CT_MYSELF))
        {
            GameTools.PLAY_AUDIO_OBJECT(this, SOUND_DEFINE.SD_MISSILE_HIT);
        }
        // 通知被导弹锁定的玩家导弹解除锁定
        if (mTarget != null && mTarget as CharacterOther != null)
        {
            CommandCharacterNotifyMissileLocked cmdLocked = newCmd(out cmdLocked);
            cmdLocked.mLocked = false;
            pushCommand(cmdLocked, mTarget);
        }
        mTarget = null;
        // 开始销毁导弹
        mItemManager.destroyItem(this);
    }