Пример #1
0
    public override void Exec(IResultControl control)
    {
        base.Exec(control);
        Actor actor = ActorManager.Singleton.Lookup(TargetID);

        if (null == actor)
        {
            return;
        }
        if (actor.Type == ActorType.enNPCTrap)
        {//机关
            ControlTrap tmpActor = actor as ControlTrap;
            tmpActor.OperateOpenAnim();
            ActorManager.Singleton.Lookup(SourceID).TargetManager.CurrentTarget = null;
        }
        else if (actor.Type == ActorType.enNPC)
        {
            NPC npc = actor as NPC;
            if (npc.GetNpcType() == ENNpcType.enBoxNPC)
            {//宝箱
                IResult r = BattleFactory.Singleton.CreateResult(ENResult.Dead, SourceID, TargetID);
                if (r != null)
                {
                    r.ResultExpr(null);
                    BattleFactory.Singleton.GetBattleContext().CreateResultControl().DispatchResult(r);
                }
            }
        }
    }
Пример #2
0
    public override void ResultServerExec(IResultControl control)
    {
        base.ResultServerExec(control);
        Actor actor = ActorManager.Singleton.Lookup(TargetID);

        if (null == actor)
        {
            return;
        }
        if (actor.Type == ActorType.enNPCTrap)
        {//机关
            ControlTrap tmpActor = actor as ControlTrap;
            tmpActor.OperateOpenAnim();
            ActorManager.Singleton.Lookup(SourceID).TargetManager.CurrentTarget = null;
        }
        else if (actor.Type == ActorType.enNPC)
        {
        }
    }
Пример #3
0
    public static Trap CreateTrapByType(int id, int staticID, CSItemGuid guid)
    {
        TrapInfo trapInfo = GameTable.TrapInfoTableAsset.Lookup(staticID);
        Trap     curTrap  = null;

        switch ((TrapType)trapInfo.TrapType)
        {
        case TrapType.enAuto:
            curTrap = new AutoTrap(id, staticID, guid);
            break;

        case TrapType.enControl:
            curTrap = new ControlTrap(id, staticID, guid);
            break;

        case TrapType.enTouchType:
            curTrap = new TouchTrap(id, staticID, guid);
            break;
        }
        return(curTrap);
    }