public void SetUp() { WorldTestHelper.GenerateInitData(); InitialSaveFileCreator i = new InitialSaveFileCreator(); _world = new World(i.CreateRelay(WorldTestHelper.INIT_DATA_PATH)); _eva = _world.tingRunner.GetTing("Eva") as Character; }
public void Setup() { D.onDLog += Console.WriteLine; WorldTestHelper.GenerateInitData(); InitialSaveFileCreator i = new InitialSaveFileCreator(); _world = new World(i.CreateRelay("../InitData1/")); _adam = _world.tingRunner.GetTing<Character>("Adam"); _seat = _world.tingRunner.CreateTing<Seat>("Chair", new WorldCoordinate("Eden", 0, 3)); }
public void GetUsedBy(Character pUser, Floppy pFloppy) { //D.Log(name + " is Getting Used By " + pUser); _user = pUser; RunProgram (pFloppy); }
public void WalkThrough(Character pCharacter) { if (targetPortal == null) { _worldSettings.Notify(pCharacter.name, "This arrow is leading nowhere!"); return; } WorldCoordinate newPosition = new WorldCoordinate(targetPortal.room.name, targetPortal.interactionPoints[0]); logger.Log(name + " used the portal " + name + " and will now teleport to " + newPosition); pCharacter.position = newPosition; pCharacter.direction = targetPortal.direction; pCharacter.StopAction(); pCharacter.StartAction("WalkingThroughPortalPhase2", null, 2.2f, 2.2f); //pCharacter.StartAction("WalkingThroughDoorPhase2", null, 2.0f, 2.0f); //_dialogueRunner.EventHappened(_user.name + "_open_" + name); }
public override void PrepareForBeingHacked() { // Accessing the getter to make sure that a program is generated if(masterProgram == null) { logger.Log("There was a problem generating the master program"); } else { masterProgram.nameOfOwner = name; } _drinker = null; }
public void DrinkFrom(Character pDrinker) { _drinker = pDrinker; masterProgram.maxExecutionTime = 10f; masterProgram.Start(); }
public void Push(Character pUser) { user = pUser; masterProgram.Start(); }
public void StartedWalkingThrough(Character pCharacter) { if (pCharacter == null) { D.Log ("pCharacter argument to StartedWalkingThrough() for fence " + name + " is null!"); return; } user = pCharacter; if(user.localPoint == interactionPoints[0]) { goalPointIndex = 1; } else { goalPointIndex = 0; } //D.Log (pCharacter.name + " started walking through fence " + name); masterProgram.Start(); if(masterProgram.ContainsErrors()) { API_Grill(); } }
public void Update(float dt, GameTime pCurrentTime, Character pCharacter, MimanTingRunner pTingRunner, RoomRunner pRoomRunner, DialogueRunner pDialogueRunner, WorldSettings pWorldSettings) { TimetableSpan currentSpan = GetCurrentSpan(pCurrentTime); if(currentSpan != TimetableSpan.NULL) { if (pCharacter.isAvatar) { return; } if(pCharacter.lastTimetableSpan != currentSpan) { if(pCharacter.lastTimetableSpan != TimetableSpan.NULL) { pCharacter.logger.Log(pCharacter.name + " ended span " + pCharacter.lastTimetableSpan.name); pCharacter.lastTimetableSpan.behaviour.OnFinish(pCharacter, pTingRunner, pRoomRunner, pDialogueRunner); } else { pCharacter.logger.Log(pCharacter.name + " ended span NULL"); } } pCharacter.lastTimetableSpan = currentSpan; //pCharacter.logger.Log("Current timetable span to update: " + currentSpan.ToString()); if(pCharacter.timetableTimer <= 0f) { pCharacter.timetableTimer = currentSpan.behaviour.Execute(pCharacter, pTingRunner, pRoomRunner, pDialogueRunner, pWorldSettings); //pCharacter.logger.Log(pCharacter.name + " executed " + currentSpan.behaviour + " and set timetableTimer to " + pCharacter.timetableTimer); } else { pCharacter.timetableTimer -= dt; //pCharacter.logger.Log(pCharacter.name + " timetableTimer = " + pCharacter.timetableTimer); } } else { D.Log("Found no matching time span in Timetable for character " + pCharacter.name + " at time " + pCurrentTime); } }
public void EvaWalksWithSaveInTheMiddle() { const string saveName = "EvaWalksWithSaveInTheMiddle.json"; // These variables are for checking that everything stays the same after loading the save IntPoint midPoint = new IntPoint(-1, -1); float walkTimerWhenSaving; int walkIteratorWhenSaving; { _eva.position = new WorldCoordinate("Hallway", IntPoint.Zero); _eva.walkSpeed = 1.0f; // 1 tile per second _eva.WalkTo(new WorldCoordinate("Hallway", new IntPoint(4, 4))); WorldTestHelper.UpdateWorld(_world, 1f); Assert.AreEqual("Walking", _eva.actionName); WorldTestHelper.UpdateWorld(_world, 2.5f); midPoint = _eva.localPoint; walkTimerWhenSaving = _eva.walkTimer; walkIteratorWhenSaving = _eva.walkIterator; _world.Save(saveName); _world = null; } { World freshWorld = new World(saveName); _eva = freshWorld.tingRunner.GetTing("Eva") as Character; Assert.AreEqual(midPoint, _eva.localPoint); Assert.AreEqual(walkTimerWhenSaving, _eva.walkTimer); Assert.AreEqual(walkIteratorWhenSaving, _eva.walkIterator); WorldTestHelper.UpdateWorld(freshWorld, 5.0f); Assert.AreEqual(new IntPoint(4, 4), _eva.localPoint); Assert.AreEqual("", _eva.actionName); } }
public void SetUp() { WorldTestHelper.GenerateInitData(); InitialSaveFileCreator i = new InitialSaveFileCreator(); _world = new World(i.CreateRelay(WorldTestHelper.INIT_DATA_PATH)); _adam = _world.tingRunner.GetTing("Adam") as Character; _eva = _world.tingRunner.GetTing("Eva") as Character; D.onDLog += (pMessage) => Console.WriteLine(pMessage); }
public void SetUp() { WorldTestHelper.GenerateInitData(); InitialSaveFileCreator i = new InitialSaveFileCreator(); _world = new World(i.CreateRelay(WorldTestHelper.INIT_DATA_PATH)); _adam = _world.tingRunner.GetTing("Adam") as Character; _eva = _world.tingRunner.GetTing("Eva") as Character; _cube = _world.tingRunner.GetTing("PowerCube") as MysticalCube; }
public void Take(Character pUser) { _user = pUser; charges -= 1; masterProgram.maxExecutionTime = 7f; masterProgram.Start(); if(onDrugUse != null) { onDrugUse(); } }
public void Fry(Character pUser, MimanTing pTing) { if (on) { _objectOnStove = pTing; masterProgram.Start (); } else { _objectOnStove = null; _worldSettings.Notify (pUser.name, "Stove is not on"); } }
public void BeInspected(Character pCharacter) { _user = pCharacter; masterProgram.Start(); }
public void PushCokeDispenserButton(Character pUser) { _user = pUser; if(dispensedCoke == null) { masterProgram.Start (); } else { Say("Can't dispense coke, tray is full", ""); } }
bool IsAllowedToTeleport(Character pUser) { return pUser != null && !pUser.talking && pUser.conversationTarget == null; }