void Awake() { ++mTurnCount; mActivePlayer = PLAYER_ID.ONE; mGamePhase = GAME_PHASE.MANA_PHASE; mActveManazone = mManazone_One; mActiveDeck = mDeck_One; mActiveHand = mHand_One; mHand_One.SetDeck(mDeck_One); mHand_Two.SetDeck(mDeck_Two); mDeck_One.SetOwner(PLAYER_ID.ONE); mDeck_Two.SetOwner(PLAYER_ID.TWO); mShieldzone_One.SetDeck(mDeck_One); mBattlezone_One.SetOwner(PLAYER_ID.ONE); mBattlezone_Two.SetOwner(PLAYER_ID.TWO); if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } }
public void EndTurn() { mActivePlayer = mActivePlayer == PLAYER_ID.ONE ? PLAYER_ID.TWO : PLAYER_ID.ONE; ChangeUI(); if (mActivePlayer == PLAYER_ID.ONE) { mZoneList = mZoneList_P1; mActveManazone = mManazone_One; mActiveDeck = mDeck_One; mActiveBattlezone = mBattlezone_One; mActiveHand = mHand_One; } else { mZoneList = mZoneList_P2; mActveManazone = mManazone_Two; mActiveDeck = mDeck_Two; mActiveBattlezone = mBattlezone_Two; mActiveHand = mHand_Two; } mActiveHand.Draw(); mActveManazone.NewTurn(); mActiveBattlezone.NewTurn(); mGamePhase = GAME_PHASE.MANA_PHASE; }
void UpdateUI() { if (m_scoreKeeper == null) { return; } if (m_isTwoPlayerGame) { for (PLAYER_ID iter = PLAYER_ID.PLAYER1; iter < PLAYER_ID.MAX; iter++) { Player player = (m_playersMap.ContainsKey(iter) ? m_playersMap[iter] : null); if (player != null) { m_scoreKeeper.SetScore(iter, player.GetVitals()); } } } else { Player player = (m_playersMap.ContainsKey(PLAYER_ID.PLAYER1) ? m_playersMap[PLAYER_ID.PLAYER1] : null); if (player != null) { m_scoreKeeper.SetScore(PLAYER_ID.PLAYER1, player.GetVitals()); } } }
public PlayerInputMessage(SEND_TYPE t, PLAYER_ID id, int hInput, int vInput) : base(DATAMESSAGE_TYPE.PLAYER_INPUT, t) { horzInput = hInput; vertInput = vInput; ID = id; }
public PlayerUpdateMessage(SEND_TYPE t, PLAYER_ID id, float xPos, float yPos, float angle) : base(DATAMESSAGE_TYPE.PLAYER_UPDATE, t) { x = xPos; y = yPos; pAngle = angle; ID = id; }
public MissileUpdateMessage(SEND_TYPE t, PLAYER_ID id, int networkID, float xPos, float yPos, int last) : base(DATAMESSAGE_TYPE.MISSILE_UPDATE, t) { ID = id; missileNetworkID = networkID; x = xPos; y = yPos; lastID = last; }
// ************************************************* // Player Manipulations // ************************************************ void ChangePlayerName(PLAYER_ID playerID, string newName) { Player player = (m_playersMap.ContainsKey(playerID) ? m_playersMap[playerID] : null); if (player != null) { PLAYER_VITALS vitals = player.GetVitals(); vitals.m_name = newName; } }
public void SetName(PLAYER_ID playerID, string newName) { if (m_playerScores == null) { return; } int index = (int)playerID - 1; if (index < m_playerScores.Length) { m_playerScores[index].SetName(newName); } }
public void SetScore(PLAYER_ID playerID, PLAYER_VITALS vitals) { if (m_playerScores == null) { return; } int index = (int)playerID - 1; if (index < m_playerScores.Length) { m_playerScores[index].Set(vitals); } }
static public int SubmitPlate(PLAYER_ID playerID, uint ingredientMask) { foreach (Customer customer in sm_waitingCustomers) { if (customer.OrderFullFilled(ingredientMask)) { customer.SetSubmittingPlayer(playerID); OrderSatisfied(customer); return(customer.GetOrderCost()); } } return(-1); }
public Missile(Azul.Rect destRect, int ownerIDNum, PLAYER_ID owner, Vec2 direction, Azul.Color color) : base(GAMEOBJECT_TYPE.MISSILE, new Azul.Rect(0, 0, 24, 6), destRect, GameObject.missileTexture, color) { //PhysicBody_Data data = new PhysicBody_Data(); //data.position = new Vec2(destRect.x, destRect.y); //data.size = new Vec2(destRect.width, destRect.height); //data.radius = 25f; //data.isSensor = true; //data.angle = 0; //data.shape_type = PHYSICBODY_SHAPE_TYPE.DYNAMIC_BOX; ownerID = ownerIDNum; MaxForce = 1000f; pOwner = owner; //CreatePhysicBody(data); LaunchAt(direction); }
public void SetSubmittingPlayer(PLAYER_ID newID) { m_submittingPlayer = newID; }
public void SetOwner(PLAYER_ID _owner) { mPlayerOwner = _owner; }
public void Set(PLAYER_ID newID, int newValue, float timeBonus = 0.0f) { m_playerID = newID; m_value = newValue; m_timeBonus = timeBonus; }
public void TestSetOwner() { mPlayerOwner = PLAYER_ID.TWO; }
public CreateMissileMessage(SEND_TYPE t, PLAYER_ID id, int uniqueMissileID) : base(DATAMESSAGE_TYPE.MISSILE_CREATE, t) { ID = id; missileNetworkID = uniqueMissileID; }
public RemoveMissileMessage(SEND_TYPE t, PLAYER_ID id, int uniqueMissileID) : base(DATAMESSAGE_TYPE.MISSILE_REMOVE, t) { ID = id; missileNetworkID = uniqueMissileID; }