Ejemplo n.º 1
0
		/**
		 * <summary>Creates a new instance of the 'Player: Switch' Action, set to swap the new Player with the old</summary>
		 * <param name = "newPlayerID">The ID number of the Player to switch to</param>
		 * <param name = "transferInventory">If True, the previous Player's inventory will be transferred to the new one</param>
		 * <returns>The generated Action</returns>
		 */
		public static ActionPlayerSwitch CreateNew_SwapCurentPlayer (int newPlayerID, bool transferInventory = false)
		{
			ActionPlayerSwitch newAction = (ActionPlayerSwitch) CreateInstance <ActionPlayerSwitch>();
			newAction.playerID = newPlayerID;
			newAction.restorePreviousData = false;
			newAction.keepInventory = transferInventory;
			newAction.newPlayerPosition = NewPlayerPosition.ReplaceCurrentPlayer;
			newAction.oldPlayer = OldPlayer.RemoveFromScene;
			return newAction;
		}
Ejemplo n.º 2
0
        /**
         * <summary>Creates a new instance of the 'Player: Switch' Action</summary>
         * <param name = "newPlayerID">The ID number of the Player to switch to</param>
         * <param name = "takeOldPlayerPosition">If True, the old Player will be removed and the new Player will be spawned in their place</param>
         * <param name = "transferInventory">If True, the previous Player's inventory will be transferred to the new one</param>
         * <returns>The generated Action</returns>
         */
        public static ActionPlayerSwitch CreateNew(int newPlayerID, bool takeOldPlayerPosition = false, bool transferInventory = false)
        {
            ActionPlayerSwitch newAction = (ActionPlayerSwitch)CreateInstance <ActionPlayerSwitch>();

            newAction.playerID              = newPlayerID;
            newAction.keepInventory         = transferInventory;
            newAction.takeOldPlayerPosition = takeOldPlayerPosition;

            return(newAction);
        }
Ejemplo n.º 3
0
		/**
		 * <summary>Creates a new instance of the 'Player: Switch' Action, set to make the old Player become an NPC</summary>
		 * <param name = "newPlayerID">The ID number of the Player to switch to</param>
		 * <param name = "transferInventory">If True, the previous Player's inventory will be transferred to the new one</param>
		 * <param name = "newSceneInfo">A data container for information about the new Player's scene. If null, the new Player will replace his associated NPC in the current scene</param>
		 * <returns>The generated Action</returns>
		 */
		public static ActionPlayerSwitch CreateNew (int newPlayerID, bool transferInventory = false, SceneInfo newSceneInfo = null)
		{
			ActionPlayerSwitch newAction = (ActionPlayerSwitch) CreateInstance <ActionPlayerSwitch>();
			newAction.playerID = newPlayerID;
			newAction.restorePreviousData = true;
			newAction.keepInventory = transferInventory;
			newAction.newPlayerPosition = (newSceneInfo != null) ? NewPlayerPosition.AppearInOtherScene : NewPlayerPosition.ReplaceAssociatedNPC;
			newAction.oldPlayer = OldPlayer.ReplaceWithAssociatedNPC;
			if (newSceneInfo != null)
			{
				newAction.newPlayerScene = newSceneInfo.number;
				newAction.newPlayerSceneName = newSceneInfo.name;
			}
			return newAction;
		}