// Use this for initialization void Start() { GameObject gameControllerObject = GameObject.FindWithTag("GameController"); if (gameControllerObject != null) { gameController = gameControllerObject.GetComponent <GameController>(); } if (gameController == null) { Debug.Log("Cannot find 'GameController' script"); } dwarfcontroller = gameObject.GetComponent <DwarfController> (); }
// === CONSTRUCTOR === public Feed(ActionController actionController) { // Get references to other parts of game engine controller = actionController; parserState = controller.PS; gameController = controller.GC; playerController = controller.PC; itemController = controller.IC; dwarfController = controller.DC; textDisplayController = controller.TDC; playerMessageController = controller.PMC; // Define behaviour for getting a subject carryOverVerb = true; subjectOptional = false; }
// === CONSTRUCTOR === public Attack(ActionController actionController) { // Get references to other parts of game engine controller = actionController; gameController = controller.GC; parserState = controller.PS; playerController = controller.PC; itemController = controller.IC; dwarfController = controller.DC; questionController = controller.QC; textDisplayController = controller.TDC; playerMessageController = controller.PMC; playerInput = controller.PI; // Define behaviour for getting a subject subjectOptional = false; // Add question used by this action questionController.AddQuestion("attack", new Question("49BareHands", null, null, true, DragonResponseYes, DragonResponseNo)); }
// Use this for initialization void Start() { dwarfcontroller = gameObject.GetComponent <DwarfController>(); }
public GameData(GameController controller, DataType dataType) { // Add data type this.dataType = dataType; // Add code dataID = ""; while (dataID.Length < 16) { dataID += characterSet[UnityEngine.Random.Range(0, characterSet.Length)]; } // Add player player = PlayerPrefs.GetInt("CurrentPlayer"); // Add text display data textLog = controller.textDisplayController.TextLog; // Add parser state ParserState parserState = controller.parserState; commandBeingProcessed = parserState.CommandBeingProcessed; commandsToProcess = parserState.CommandsToProcess; subjectCarriedOver = parserState.SubjectCarriedOver; verbCarriedOver = parserState.VerbCarriedOver; // Add game controller data clock1 = controller.Clock1; clock2 = controller.Clock2; currentCaveStatus = controller.CurrentCaveStatus; currentGameStatus = controller.CurrentGameStatus; lampLife = controller.LampLife; lampWarning = controller.LampWarning; numDeaths = controller.NumDeaths; panic = controller.Panic; turns = controller.Turns; wasDark = controller.WasDark; // Add player data PlayerController playerController = controller.playerController; currentLocation = playerController.CurrentLocation; oldLocations = playerController.OldLocations; // Add commands data CommandsController commandsController = controller.commandsController; magicWordText = commandsController.MagicWordText; oldItem = commandsController.OldItem; westCount = commandsController.WestCount; // Add location data LocationController locationController = controller.locationController; detailMsgCount = locationController.DetailMsgCount; locViews = locationController.LocViews; timesToAbbreviateLocation = locationController.TimesToAbbreviateLocation; // Add items data ItemController itemController = controller.itemController; itemDict = itemController.ItemDict; treasuresSeen = itemController.TreasuresSeen; // Add actions data ActionController actionController = controller.actionController; foobar = actionController.Foobar; goCount = actionController.GoCount; // Add dwarf data DwarfController dwarfController = controller.dwarfController; activationLevel = dwarfController.ActivationLevel; dwarves = dwarfController.Dwarves; dwarvesKilled = dwarfController.DwarvesKilled; // Add score data ScoreController scoreController = controller.scoreController; bonusPoints = scoreController.BonusPoints; closedHintShown = scoreController.ClosedHintShown; savePenaltyPoints = scoreController.SavePenaltyPoints; thresholdIndex = scoreController.ThresholdIndex; turnsPointsLost = scoreController.TurnsPointsLost; isNovice = scoreController.IsNovice; reachedEnd = scoreController.ReachedEnd; // Add hints data hintActivations = controller.hintController.HintActivations; // Add question data currentQuestion = controller.questionController.CurrentQuestion; }