Example #1
0
        protected void initialize()
        {
            Id     = pcIds;
            pcIds += GameMasterOne.dataTypes;

            //myOrientationBehavior = new TileBehaviorSquare();
            throw new Exception("Tile behavior not set on PC. Method:Initialize()");
            MyNPCBehavior = new NPCBehaviorPC();
            MyFoH         = new NoiseMap();
            myFOV         = new List <IPoint>();
            myAttacks     = new List <Attack>();
            this.addStat(new Stat("Strength", 0));
            this.addStat(new Stat("Armor", 0));
            this.addStat(new Stat("Weapon Skill", 0));
            this.addStat(new Stat("Perception", 0));
            this.addStat(new Stat("Intelligence", 0));
            this.addStat(new Stat("Dexterity", 0));
            this.addStat(new Stat("Suspicion", 0));
            this.addStat(new Stat("Alert Status", 0));
            this.addStat(new Stat("Field of View", 0));
            this.addStat(new Stat("Suspicion Propensity", 0));
            this.addStat(new Stat("AP", 0));
            this.addStat(new Stat("Turn Over", 0));
            this.addStat(new Stat("Remaining AP", this.getStat("AP").Value));
            this.addStat(new Stat("Movement Cost", SneakingWorld.getValueByName("movementCost")));
            this.addStat(new Stat("Turns In Place", 0));
            this.addStat(new Stat("Active", 0));
            this.addStat(new Stat("Selected", 0));
            this.addStat(new Stat("Is Visible", 0));
            this.addStat(new Stat("Is Sneaking", 0));
        }
Example #2
0
        protected void initialize()
        {
            Id        = guardIds;
            guardIds += GameMasterOne.dataTypes;

            //myOrientationBehavior = new TileBehaviorSquare();
            MyNPCBehavior = new NPCBehaviorNPC();
            //myKnownNoiseBehavior = new KnownNoiseMapBehaviorAllGuards();

            MyNoiseMap = new NoiseMap();
            myFOV      = new List <IPoint>();

            this.addStat(new Stat("Strength", 0));
            this.addStat(new Stat("Armor", 0));
            this.addStat(new Stat("Weapon Skill", 0));
            this.addStat(new Stat("Perception", 0));
            this.addStat(new Stat("Intelligence", 0));
            this.addStat(new Stat("Dexterity", 0));
            this.addStat(new Stat("Suspicion", 0));
            this.addStat(new Stat("Alert Status", 0));
            this.addStat(new Stat("Field of View", 0));
            this.addStat(new Stat("Suspicion Propensity", 0));
            this.addStat(new Stat("AP", 0));
            this.addStat(new Stat("Knows Map", 0));
            this.addStat(new Stat("Turn Over", 0));
            this.addStat(new Stat("Remaining AP", this.getStat("AP").Value));
            this.addStat(new Stat("Movement Cost", SneakingWorld.getValueByName("movementCost")));
            this.addStat(new Stat("Turns In Place", 0));
            this.addStat(new Stat("Active", 0));
            this.addStat(new Stat("Selected", 0));
            this.addStat(new Stat("Is Visible", 0));
            this.addStat(new Stat("Is Dead", 0));
            this.addStat(new Stat("Health", this.getStat("Strength").BaseValue *3));

            //Status
            this.addStat(new Stat("Status Normal", 5));
            this.addStat(new Stat("Status Suspicious", 10));
            this.addStat(new Stat("Status Alert", 15));
            this.getStat("Alert Status").ItsMax = (int)this.getStat("Status Alert").BaseValue;
        }
Example #3
0
        public List <IGuard> loadGuards(XmlDocument myDoc)
        {
            XmlNode positionNode, positionXNode, positionYNode,
                    patrolNode, wpXNode, wpYNode, orientationNode;
            XmlNodeList guardNodes = myDoc.GetElementsByTagName("Character"),
                        waypointNodes;

            myGuards = new List <Guard>();
            Guard      _cGuard;
            PatrolPath _cPath;

            #region READ GUARDS TO LIST
            if (guardNodes != null)
            {
                foreach (XmlNode g in guardNodes)
                {
                    _cGuard = new Guard();
                    _cPath  = new PatrolPath();

                    _cGuard.fromXml(g);
                    _cGuard.setStat("Status Alert", SneakingWorld.getValueByName("Status Alert"));
                    _cGuard.setStat("Status Suspicious", SneakingWorld.getValueByName("Status Suspicious"));
                    _cGuard.setStat("Status Normal", SneakingWorld.getValueByName("Status Normal"));

                    //Read Position
                    positionNode  = ((XmlElement)g).SelectNodes("Position")[0];
                    positionXNode = ((XmlElement)positionNode).SelectNodes("X")[0];
                    positionYNode = ((XmlElement)positionNode).SelectNodes("Y")[0];


                    _cGuard.MyPosition = new PointObj(Int32.Parse(positionXNode.InnerText),
                                                      Int32.Parse(positionYNode.InnerText),
                                                      0);
                    //Read Patrol
                    //First, put guard position as first waypoint
                    _cPath.MyWaypoints.Add(_cGuard.MyPosition);

                    //Add rest of waypoints
                    patrolNode = ((XmlElement)g).SelectNodes("Patrol")[0];
                    if (patrolNode != null)
                    {
                        waypointNodes = ((XmlElement)patrolNode).GetElementsByTagName("Waypoint");
                        foreach (XmlElement wp in waypointNodes)
                        {
                            wpXNode = wp.SelectNodes("X")[0];
                            wpYNode = wp.SelectNodes("Y")[0];
                            _cPath.MyWaypoints.Add(new PointObj(Int32.Parse(wpXNode.InnerText),
                                                                Int32.Parse(wpYNode.InnerText),
                                                                0));
                        }
                    }
                    //save patrol in guard
                    _cGuard.getNPCBehavior().setPatrol(_cPath);

                    //Add guard to list
                    myGuards.Add(_cGuard);
                }
            }
            #endregion
            List <IGuard> iguards = new List <IGuard>();
            foreach (Guard g in myGuards)
            {
                iguards.Add(g);
            }

            return(iguards);
        }