Ejemplo n.º 1
0
 public Doodad(Doodad d, Room r, Vector3 n, Vector3 u)
 {
     position = d.position.Unfold(r, n, u);
     type = d.type;
     toggleOn = d.toggleOn;
     targetDoodad = d.targetDoodad;
     active = d.active;
     srcDoodad = d;
     stateTransition = d.stateTransition;
 }
Ejemplo n.º 2
0
        public Doodad(VL.Doodad xmlDoodad, Vector3 normal)
        {
            srcDoodad = this;
            this.type = xmlDoodad.type;
            this.id = xmlDoodad.IDString;
            this.targetBehavior = xmlDoodad.targetBehavior;
            this.targetObject = xmlDoodad.targetObject;
            this.expectedBehavior = xmlDoodad.expectBehavior;
            this.activationCost = xmlDoodad.activationCost;

            this.abilityType = (AbilityType)xmlDoodad.ability;
            this.originalAbilityType = (AbilityType)xmlDoodad.ability;
            this.position = new Vertex(xmlDoodad.position, normal, Vector3.Zero, xmlDoodad.up);
            this.spawnPosition = new Vertex(xmlDoodad.position, normal, Vector3.Zero, xmlDoodad.up);
            behaviors = new List<Behavior>();
            currentBehavior = null;

            if (isOrb)
                active = true;
            if (type == VL.DoodadType.BluePowerStation)
                orbsRemaining = 1;
            if (type == VL.DoodadType.RedPowerStation)
                orbsRemaining = 1;

            if (type == VL.DoodadType.WallSwitch)
                stateTransition = 0;
            if (isStation)
                stateTransition = 0;
        }
Ejemplo n.º 3
0
        public Doodad(VL.DoodadType type, Vector3 position, Vector3 normal, Vector3 direction)
        {
            id = "d_"+type.ToString();
            srcDoodad = this;
            this.type = type;
            this.position = new Vertex(position, normal, Vector3.Zero, direction);
            this.spawnPosition = new Vertex(position, normal, Vector3.Zero, direction);
            behaviors = new List<Behavior>();
            currentBehavior = null;
            if (type == VL.DoodadType.LeftDoor || type == VL.DoodadType.RightDoor)
                stateTransition = 0;

            if (isOrb)
                active = true;
        }
Ejemplo n.º 4
0
        public Doodad(Doodad d)
        {
            srcDoodad = this;
            style = d.style;
            //unfoldedPosition = new Vertex(d.unfoldedPosition);
            position = new Vertex(d.position);
            spawnPosition = new Vertex(d.spawnPosition);
            active = d.active;

            available = d.available;
            id = d.id;
            idle = d.idle;
            targetBehavior = d.targetBehavior;
            targetObject = d.targetObject;
            expectedBehavior = d.expectedBehavior;
            alreadyUsed = d.alreadyUsed;
            type = d.type;
            behaviors = d.behaviors;
            currentBehaviorId = d.currentBehaviorId;
            if(d.currentBehavior != null)
                currentBehaviorId = d.currentBehavior.id;
            orbsRemaining = d.orbsRemaining;
            doorDecal = d.doorDecal;
            currentTime = d.currentTime;
            nextBehavior = d.nextBehavior;
            breakTime = d.breakTime;
            behaviorStarted = d.behaviorStarted;
            toggleOn = d.toggleOn;
            abilityType = d.abilityType;
            originalAbilityType = d.originalAbilityType;
            cooldown = d.cooldown;
            activationCost = d.activationCost;
            speaker = d.speaker;
            targetDoodadId = d.targetDoodadId;
            if(d.targetDoodad != null)
                targetDoodadId = d.targetDoodad.id;
            targetBlockId = d.targetBlockId;
            if (d.targetBlock != null)
                targetBlockId = d.targetBlock.id;
            targetEdgeId = d.targetEdgeId;
            if (d.targetEdge != null)
                targetEdgeId = d.targetEdge.id;

            targetRoomId = d.targetRoomId;
            if(d.targetRoom != null)
                targetRoomId = d.targetRoom.id;
            stateTransition = d.stateTransition;
            stateTransitionDir = d.stateTransitionDir;
            stateTransitionVelocity = d.stateTransitionVelocity;
            _powered = d._powered;
            behaviors = new List<Behavior>();
            foreach (Behavior b in d.behaviors)
            {
                behaviors.Add(new Behavior(b));
            }
        }