Beispiel #1
0
        protected bool shouldShoot; //Determines if the player should shoot.

        #endregion Fields

        #region Constructors

        //The initial direction of each player is down.
        protected Player(string name, GridPosition position, ObjectColor color)
            : base(position, 'V', color)
        {
            this.Name = name;
            this.Score = 0;
            this.Health = Player.PlayerMaxHealth;

            this.shouldShoot = false;
            this.lastMoveDirection = new GridPosition(1, 0);
        }
Beispiel #2
0
	// Use this for initialization
	void Start () {
		selectedObject = null;
        objColor = this.GetComponent<ObjectColor>();
        spriteRend = this.GetComponent<SpriteRenderer>();
        orbitalScript = this.GetComponent<OrbitalsScript>();
        initCol = spriteRend.color;
        if(objColor == null) {
            Debug.LogError("Goal must have an object color component.");
        }
	}
Beispiel #3
0
 /// <summary>
 /// Returns a block created from the specified type, position and color.
 /// </summary>
 public static StaticObject CreateBlock(int blockType, GridPosition position, ObjectColor color)
 {
     switch (blockType)
     {
         case 0: return new Wall(position, color);
         case 1: return new GiftBlock(position, color, rand.Next(0, 10));
         case 2: return new HealthBlock(position);  //The health block is always red.
         case 3: return new Obstacle(position, color);
         default: return new Obstacle(position, color);
     }
 }
Beispiel #4
0
 public GiftBlock(GridPosition position, ObjectColor color, int bonus)
     : base(position, '$', color)
 {
     if (bonus < 0 || bonus > 9)
     {
         throw new ArgumentOutOfRangeException();
     }
     else
     {
         this.Bonus = bonus;
     }
 }
Beispiel #5
0
    /// <summary>
    /// ビームをあてる
    /// </summary>
    public virtual void Irradiated(ObjectColor laserColor)
    {
        if (currentFrame == Time.frameCount)
        {
            IrradiationColor.state |= laserColor.state;
        }
        else
        {
            currentFrame = Time.frameCount;
            IrradiationColor.state = laserColor.state;
        }

        return;
    }
Beispiel #6
0
        public Structure(ObjectType mStructureType, ContentManager content,
                         SpriteState defaultState, Vector2 SpritePosition, ObjectColor mStructureColor, Vector2 ButtonPosition)
            : base(mStructureType, content, defaultState, SpritePosition, Hostility.STRUCTURE)
        {
            this.mStructureType = mStructureType;
            this.mStructureColor = mStructureColor;
            this.content = content;
            this.defaultState = defaultState;
            this.mSpritePosition = SpritePosition;
            this.mButtonPosition = ButtonPosition;

            mStructureAttribute = new StructureAttribute(content, this);
            SetAttributes();
            SetUnitAnimation();
        }
Beispiel #7
0
        public HumanPlayer(string name, GridPosition position, ObjectColor color, IUserInterface userInterface)
            : base(name, position, color)
        {
            this.userInterface = userInterface;

            this.userInterface.OnLeftRequest += OnMoveLeft;

            this.userInterface.OnRightRequest += OnMoveRight;

            this.userInterface.OnDownRequest += OnMoveDown;

            this.userInterface.OnUpRequest += OnMoveUp;

            this.userInterface.OnActionRequest += OnShoot;
        }
Beispiel #8
0
        public const int Damage = 25; //The damage done by a bullet.

        #endregion Fields

        #region Constructors

        public Bullet(GridPosition position, ObjectColor color, GridPosition direction)
            : base(position, '+', color, direction)
        {
        }
Beispiel #9
0
 public static string Key(ObjectColor color)
 {
     return(AuctionFilterType.ColorFilter.ToString() + color.ToString());
 }
Beispiel #10
0
 public ScoreBlock(GridPosition position, ObjectColor color, int bonus)
     : base(position, (char)(bonus + '0'), color)
 {
 }
        internal static void ListenForRallyPoint()
        {
            if (RallyTargetState == RallyFetchTarget.ACTIVE && GameController.PlayingField.Contains(mouseRectangle))
            {

                switch (objectColor)
                {
                    case ObjectColor.BLUE:

                        GameObject.mPotentialTargetListList.Reset();
                        for (int i = 0; i < GameObject.mPotentialTargetListList.GetCount(); i++)
                        {

                            if (GameObject.mPotentialTargetListList.GetCurrent().gameObject.Hostility == Hostility.FRIENDLY &&
                                !(GameObject.mPotentialTargetListList.GetCurrent().gameObject is Hero))
                            {
                                Friendly temp = (Friendly)GameObject.mPotentialTargetListList.GetCurrent().gameObject;

                                if (temp.Color == ObjectColor.BLUE)
                                {

                                    temp.DefaultTarget = new Vector2(mouseState.X, mouseState.Y);
                                }
                            }

                            GameObject.mPotentialTargetListList.NextNode();
                        }
                        if (GameController.InPlayStructures[0] != null)
                            GameController.InPlayStructures[0].StructureAttribute.DefaultUnitTarget = new Vector2(mouseState.X, mouseState.Y);
                        break;

                    case ObjectColor.GREEN:

                        GameObject.mPotentialTargetListList.Reset();
                        for (int i = 0; i < GameObject.mPotentialTargetListList.GetCount(); i++)
                        {
                            if (GameObject.mPotentialTargetListList.GetCurrent().gameObject.Hostility == Hostility.FRIENDLY &&
                                !(GameObject.mPotentialTargetListList.GetCurrent().gameObject is Hero))
                            {
                                Friendly temp = (Friendly)GameObject.mPotentialTargetListList.GetCurrent().gameObject;

                                if (temp.Color == ObjectColor.GREEN)
                                {
                                    temp.DefaultTarget = new Vector2(mouseState.X, mouseState.Y);
                                }
                            }
                            GameObject.mPotentialTargetListList.NextNode();
                        }
                        if (GameController.InPlayStructures[3] != null)
                            GameController.InPlayStructures[3].StructureAttribute.DefaultUnitTarget = new Vector2(mouseState.X, mouseState.Y);

                        break;

                    case ObjectColor.PURPLE:

                        GameObject.mPotentialTargetListList.Reset();
                        for (int i = 0; i < GameObject.mPotentialTargetListList.GetCount(); i++)
                        {
                            if (GameObject.mPotentialTargetListList.GetCurrent().gameObject.Hostility == Hostility.FRIENDLY &&
                                !(GameObject.mPotentialTargetListList.GetCurrent().gameObject is Hero))
                            {
                                Friendly temp = (Friendly)GameObject.mPotentialTargetListList.GetCurrent().gameObject;

                                if (temp.Color == ObjectColor.PURPLE)
                                {
                                    temp.DefaultTarget = new Vector2(mouseState.X, mouseState.Y);
                                }
                            }
                            GameObject.mPotentialTargetListList.NextNode();
                        }
                        if (GameController.InPlayStructures[4] != null)
                            GameController.InPlayStructures[4].StructureAttribute.DefaultUnitTarget = new Vector2(mouseState.X, mouseState.Y);

                        break;

                    case ObjectColor.RED:

                        GameObject.mPotentialTargetListList.Reset();
                        for (int i = 0; i < GameObject.mPotentialTargetListList.GetCount(); i++)
                        {
                            if (GameObject.mPotentialTargetListList.GetCurrent().gameObject.Hostility == Hostility.FRIENDLY &&
                                !(GameObject.mPotentialTargetListList.GetCurrent().gameObject is Hero))
                            {
                                Friendly temp = (Friendly)GameObject.mPotentialTargetListList.GetCurrent().gameObject;

                                if (temp.Color == ObjectColor.RED)
                                {
                                    temp.DefaultTarget = new Vector2(mouseState.X, mouseState.Y);
                                }
                            }
                            GameObject.mPotentialTargetListList.NextNode();
                        }
                        if (GameController.InPlayStructures[1] != null)
                            GameController.InPlayStructures[1].StructureAttribute.DefaultUnitTarget = new Vector2(mouseState.X, mouseState.Y);

                        break;

                    case ObjectColor.YELLOW:

                        GameObject.mPotentialTargetListList.Reset();
                        for (int i = 0; i < GameObject.mPotentialTargetListList.GetCount(); i++)
                        {
                            if (GameObject.mPotentialTargetListList.GetCurrent().gameObject.Hostility == Hostility.FRIENDLY &&
                                !(GameObject.mPotentialTargetListList.GetCurrent().gameObject is Hero))
                            {
                                Friendly temp = (Friendly)GameObject.mPotentialTargetListList.GetCurrent().gameObject;

                                if (temp.Color == ObjectColor.YELLOW)
                                {
                                    temp.DefaultTarget = new Vector2(mouseState.X, mouseState.Y);
                                }
                            }
                            GameObject.mPotentialTargetListList.NextNode();
                        }
                        if (GameController.InPlayStructures[2] != null)
                            GameController.InPlayStructures[2].StructureAttribute.DefaultUnitTarget = new Vector2(mouseState.X, mouseState.Y);

                        break;

                    default:
                        break;
                }

                RallyTargetState = RallyFetchTarget.INACTIVE;
                objectColor = ObjectColor.NULL;
                HeroActionGroupState = HeroActionButtonGroupState.HERO_ACTION;

            }
        }
Beispiel #12
0
 public void SetCurrentColor(ObjectColor val)
 {
     currentColor = val;
     UpdateSkinnedMeshColor();
     UpdateMeshColor();
 }
 public ContractSchemeDataReward(XElement element)
     : base(element)
 {
     color = (ObjectColor)Enum.Parse(typeof(ObjectColor), element.GetString("color"));
 }
Beispiel #14
0
 public GameObject(char c, ObjectColor color)
 {
     Char      = c;
     ForeColor = color;
     BackColor = new ObjectColor(Console.BackgroundColor);
 }
Beispiel #15
0
 public StaticObject(GridPosition position, char image, ObjectColor color)
     : base(position, image, color)
 {
 }
 internal static void BlueRallyButtonFunction()
 {
     AudioController.ButtonClick3SoundEffectInstance.Play();
     RallyTargetState = RallyFetchTarget.ACTIVE;
     objectColor = ObjectColor.BLUE;
 }
Beispiel #17
0
 public Obstacle(GridPosition position, ObjectColor color)
     : base(position, '#', color)
 {
 }
Beispiel #18
0
 /// <summary>
 /// Checks if the two ObjectColor objects have the same color.
 /// </summary>
 public bool CheckSameColor(ObjectColor other) {
     return CheckSameColor(other.GetColor());
 }
Beispiel #19
0
 public SchemeInitData(string id, string name, int level, Workshop workshop, string templateModuleId, ObjectColor color,
                       Dictionary <string, int> craftingMaterials, string inSetID)
 {
     this.Id                = id;
     this.Name              = name;
     this.Level             = level;
     this.Workshop          = workshop;
     this.TemplateModuleId  = templateModuleId;
     this.Color             = color;
     this.CraftingMaterials = craftingMaterials;
     setID = inSetID;
 }