public void changeGhostModes(GhostAI.Modes newMode) { blinky.setGlobalMode(newMode); pinky.setGlobalMode(newMode); inky.setGlobalMode(newMode); clyde.setGlobalMode(newMode); }
// If Pacman dies, reset the ghosts back to the original position and set game flags public void PacmanDeath() { if (!blinky) { return; } StartCoroutine(Pause(1.25f)); bGlobalCounter = true; globalDotCount = 0; // Destroy the game objects. Destroy(blinky.gameObject); Destroy(clyde.gameObject); Destroy(inky.gameObject); Destroy(pinky.gameObject); // Destroy the scripts. Destroy(blinky); Destroy(clyde); Destroy(inky); Destroy(pinky); blinky = null; clyde = null; inky = null; pinky = null; houseTimer = 0; modeTimer = 0; modeCount = 0; }
// Token: 0x060006CA RID: 1738 RVA: 0x00025DC5 File Offset: 0x00023FC5 public DoorState(GhostAI ghostAI, GhostInteraction ghostInteraction, GhostInfo ghostInfo, PhotonObjectInteract obj) { this.ghostAI = ghostAI; this.ghostInteraction = ghostInteraction; this.ghostInfo = ghostInfo; this.door = obj.GetComponent <Door>(); }
public override void enter (GhostAI ghost) { Debug.Log("State enter executed...."); Debug.Log("Scared State"); base.enter(ghost); }
private IEnumerator Spawn() { yield return(new WaitForSeconds(startDelay)); while (true) { for (int i = 0; i < waveSpawnAmount; i++) { float yPos = Random.Range(minMax.x, minMax.y); GameObject go = Instantiate(ghosts[Random.Range(0, ghosts.Length)], new Vector3(transform.position.x, yPos, 0f), Quaternion.identity, transform); GhostAI gAI = go.GetComponent <GhostAI>(); if (gAI.ghostType == GhostType.Sinnie) { gAI.amplitudeScalar += Random.Range(0, sinnieAmpMaxOffset); gAI.speed += Random.Range(0, sinnieSpeedMaxOffset); } else if (gAI.ghostType == GhostType.Straitous) { gAI.speed += Random.Range(0, straitousSpeedMaxOffset); } yield return(new WaitForSeconds(delayPerSpawn)); } yield return(new WaitForSeconds(delayPerWave)); } }
public void killGhost(string ghostName) { GameObject ghostGO = _ghostsGOs[ghostName]; if (ghostGO == null) { return; } // kill ghost GhostAI ai = ghostGO.GetComponent <GhostAI>(); if (ai.state == GhostAIState.Dead) { return; } ai.state = GhostAIState.Dead; // deactivate collisions Collider ghostCollider = ghostGO.GetComponent <Collider>(); Collider pacmanCollider = _pacmanGO.GetComponent <Collider>(); Physics.IgnoreCollision(ghostCollider, pacmanCollider, true); // give points to pacman if (_pacmanGO.GetComponent <PacmanAI>().powerTime <= 0f) { _ghostScoreMultiplier = 1; } _pacmanData.score += Score.Ghost * _ghostScoreMultiplier; _ghostScoreMultiplier *= Score.GhostEatenMultiplierFactor; }
// Token: 0x06000653 RID: 1619 RVA: 0x0002314A File Offset: 0x0002134A public PoltergeistPower(GhostAI ghostAI, GhostInteraction ghostInteraction, LayerMask mask, PhotonObjectInteract[] props) { this.ghostInteraction = ghostInteraction; this.mask = mask; this.ghostAI = ghostAI; this.props = props; }
// Token: 0x06000645 RID: 1605 RVA: 0x00022D3F File Offset: 0x00020F3F public BansheePower(GhostAI ghostAI, GhostInteraction ghostInteraction, GhostAudio ghostAudio, NavMeshAgent agent, LayerMask mask) { this.ghostInteraction = ghostInteraction; this.ghostAudio = ghostAudio; this.ghostAI = ghostAI; this.agent = agent; this.mask = mask; }
// Start is called before the first frame update void Start() { ai = gameObject.GetComponent <GhostAI>(); gate = GameObject.Find("Gate(Clone)"); pacMan = GameObject.Find("PacMan(Clone)") ? GameObject.Find("PacMan(Clone)") : GameObject.Find("PacMan 1(Clone)"); scatterTarget = new GameObject("Clyde Target"); scatterTarget.transform.position = new Vector3(3, -29, 2); }
// Use this for initialization new void Start() { base.Start(); if (blinky == null) { blinky = gameController.blinky; } }
public PatrolNode(GhostAI ai, NavMeshAgent agent, Blackboard blackboard, float patrollingSpeed, float chaseSpeed, int pillsRemainingToEnraged) { this.ai = ai; this.agent = agent; this.blackboard = blackboard; this.patrollingSpeed = patrollingSpeed; this.chaseSpeed = chaseSpeed; this.pillsRemainingToEnraged = pillsRemainingToEnraged; }
private IEnumerator GhostDespawnRoutine(GhostAI ghost) { ghost.GhostVFX.BecomeInvisible(); yield return(new WaitUntil(() => !ghost.GhostVFX.IsVisible)); ghost.gameObject.SetActive(false); ghost.transform.parent = transform; _inactiveGhostPool.Push(ghost); }
// Start is called before the first frame update void Start() { ai = gameObject.GetComponent <GhostAI>(); gate = GameObject.Find("Gate(Clone)"); pacMan = GameObject.Find("PacMan(Clone)") ? GameObject.Find("PacMan(Clone)") : GameObject.Find("PacMan 1(Clone)"); pacManMove = pacMan.GetComponent <Movement>(); pinkyTarget = new GameObject("Pinky Target"); line = gameObject.GetComponent <LineRenderer>(); }
/// <summary> /// Обрабатываем столкновения с другими объектами /// </summary> void OnTriggerEnter(Collider other) { switch (other.tag) { case "Bonuses": Bonuses bonus = other.GetComponent <Bonuses>(); FindObjectOfType <Game>().AddScore(bonus.score); switch (bonus.BonusType) { case Bonuses.TypeBounes.PowerUp: foreach (GhostAI g in FindObjectsOfType <GhostAI>()) { g.ChangeMode(GhostAI.ModeBehavior.outrun); } MainController.Instance.SoundEatPowerUp.Play(); break; case Bonuses.TypeBounes.Point: if (--prm.PointsCount <= 0) { FindObjectOfType <Game>().NextLevel(); } MainController.Instance.SoundEatPoint.Play(); break; case Bonuses.TypeBounes.Fruit: MainController.Instance.SoundEatFruit.Play(); break; } bonus.gameObject.SetActive(false); break; case "Ghosts": GhostAI ghost = other.GetComponent <GhostAI>(); MainController.Instance.SoundIntermission.Play(); switch (ghost.BehaviorMode) { case GhostAI.ModeBehavior.chase: case GhostAI.ModeBehavior.around: MainController.Instance.SoundDeath.Play(); FindObjectOfType <Game>().ShowGameMessage(Game.MessageState.kill); break; case GhostAI.ModeBehavior.outrun: ghost.ChangeMode(GhostAI.ModeBehavior.backtobase); FindObjectOfType <Game>().AddScore(200); MainController.Instance.SoundEatGhost.Play(); break; case GhostAI.ModeBehavior.backtobase: break; } break; } }
public void Start() { GameObject ghostBody = transform.Find(Tags.GhostBody).gameObject; bodyRenderer = ghostBody.GetComponent <Renderer>(); chaseMaterial = bodyRenderer.materials[0]; frightenedMaterial = bodyRenderer.materials[1]; materialIndex = 0; ai = GetComponent <GhostAI>(); lastState = GhostAIState.Chase; }
public void OnCollisionEnter(Collision collision) { if (collision.transform.gameObject.tag == Tags.Ghost) { GhostAI ghostAI = collision.transform.gameObject.GetComponent <GhostAI>(); if (ghostAI.state != GhostAIState.Dead) { explode(); } } }
public void SetGrid(Grid grid) { _grid = grid; _pathList = new Queue <Point>(new List <Point> { _grid.GhostBeginPosition }); _ai = new GhostAI(_grid); }
private void InstantiateGhosts() { blinky = (GhostAI)Instantiate(blinkyPrefab, new Vector2(14f, -14.5f), blinkyPrefab.gameObject.transform.rotation); pinky = (GhostAI)Instantiate(pinkyPrefab, pinkyPrefab.houseTile, pinkyPrefab.gameObject.transform.rotation); inky = (GhostAI)Instantiate(inkyPrefab, inkyPrefab.houseTile, inkyPrefab.gameObject.transform.rotation); clyde = (GhostAI)Instantiate(clydePrefab, clydePrefab.houseTile, clydePrefab.gameObject.transform.rotation); blinky.gameController = this; pinky.gameController = this; inky.gameController = this; clyde.gameController = this; }
// Start is called before the first frame update void Start() { ai = gameObject.GetComponent <GhostAI>(); gate = GameObject.Find("Gate(Clone)"); pacMan = GameObject.Find("PacMan(Clone)") ? GameObject.Find("PacMan(Clone)") : GameObject.Find("PacMan 1(Clone)"); pinky = GameObject.Find("Pinky(Clone)") ? GameObject.Find("Pinky(Clone)") : GameObject.Find("Pinky 1(Clone)"); pacManMove = pacMan.GetComponent <Movement>(); pinkyMove = pinky.GetComponent <Movement>(); inkyTarget = new GameObject("inky Target"); line = gameObject.GetComponent <LineRenderer>(); scatterTarget = new GameObject("Inky Target"); scatterTarget.transform.position = new Vector3(26, -1, 2); }
void OnTriggerStay(Collider col) { Debug.Log("Sword hit!"); if (col.gameObject.tag == "Enemy") { GhostAI g = col.gameObject.GetComponent <GhostAI>(); if (g.health > 0) { g.health -= 15f; if (g.health <= 0) { score += 5; } } } }
// Token: 0x06000772 RID: 1906 RVA: 0x0002B4E4 File Offset: 0x000296E4 private void CreateGhost() { if (this.createdGhost) { return; } this.ghostTraits.ghostType = (GhostTraits.Type)Random.Range(1, 13); if (PlayerPrefs.HasKey("isDeveloperVersion") && PlayerPrefs.GetInt("isDeveloperVersion") == 1 && PlayerPrefs.GetInt("Developer_GhostType") != 0) { this.ghostTraits.ghostType = (GhostTraits.Type)PlayerPrefs.GetInt("Developer_GhostType"); } this.ghostTraits.deathLength = Random.Range(50, 1000); this.ghostTraits.ghostAge = Random.Range(10, 90); this.ghostTraits.isMale = (Random.Range(0, 2) == 0); this.ghostTraits.favouriteRoomID = Random.Range(0, LevelController.instance.rooms.Length); this.ghostTraits.isShy = (Random.Range(0, 2) == 1); string prefabName = Constants.maleGhostNames[0]; if (this.ghostTraits.isMale) { this.ghostTraits.ghostName = LevelController.instance.possibleMaleFirstNames[Random.Range(0, LevelController.instance.possibleMaleFirstNames.Length)] + " " + LevelController.instance.possibleLastNames[Random.Range(0, LevelController.instance.possibleLastNames.Length)]; prefabName = Constants.maleGhostNames[Random.Range(0, Constants.maleGhostNames.Length)]; } else { this.ghostTraits.ghostName = LevelController.instance.possibleFemaleFirstNames[Random.Range(0, LevelController.instance.possibleFemaleFirstNames.Length)] + " " + LevelController.instance.possibleLastNames[Random.Range(0, LevelController.instance.possibleLastNames.Length)]; prefabName = Constants.femaleGhostNames[Random.Range(0, Constants.femaleGhostNames.Length)]; } GhostAI component = PhotonNetwork.InstantiateSceneObject(prefabName, this.spawn.position, this.spawn.rotation, 0, null).GetComponent <GhostAI>(); component.ghostInfo.ghostTraits = this.ghostTraits; this.view.RPC("GhostHasBeenCreated", PhotonTargets.AllBuffered, Array.Empty <object>()); Collider collider = LevelController.instance.rooms[this.ghostTraits.favouriteRoomID].colliders[Random.Range(0, LevelController.instance.rooms[this.ghostTraits.favouriteRoomID].colliders.Count)]; Vector3 pos = new Vector3(Random.Range(collider.bounds.min.x, collider.bounds.max.x), collider.bounds.min.y, Random.Range(collider.bounds.min.z, collider.bounds.max.z)); Vector3 zero = Vector3.zero; if (this.GetPositionOnNavMesh(pos, out zero)) { component.agent.Warp(zero); } }
void OnCollisionEnter(Collision other) { if (other.collider.gameObject.tag == "Floor") { return; } if (other.collider.gameObject.tag != "Pellet") { string other_tag = other.collider.gameObject.tag; if (other_tag == "Ghost" || other_tag == "Player") { GhostAI g_ai = other.collider.gameObject.GetComponent <GhostAI>(); if (g_ai.IsVulnerable()) { _score -= other_tag == "Ghost" ? ROBOT_GHOST_POINTS : PERSON_GHOST_POINTS; if (other_tag == "Player") { PlayerController pc = other.collider.gameObject.GetComponent <PlayerController>(); pc.LoseLife(); } AudioSource death_sound = other.collider.gameObject.GetComponent <AudioSource>(); death_sound.Play(); // other.transform.position = g_ai._ghost_start.transform.position; g_ai.Reset(); } else { _score -= other_tag == "Ghost" ? ROBOT_GHOST_POINTS : PERSON_GHOST_POINTS; transform.position = _pacman_start.transform.position; if (other_tag == "Player") { LoseLife(); } } SetCountText(); } } }
public void ResetAll() { Time.timeScale = 1f; PacManAI pacman_ai = _pacman.GetComponent <PacManAI>(); pacman_ai.Reset(); Transform[] ghosts = _ghosts.GetComponentsInChildren <Transform>(); foreach (Transform t in ghosts) { if (t.gameObject.tag == "Ghost" || t.gameObject.tag == "Player") { GhostAI gai = t.gameObject.GetComponent <GhostAI>(); gai.Reset(); if (t.gameObject.tag == "Player") { PlayerController pc = t.gameObject.GetComponent <PlayerController>(); pc.Reset(); } } } Transform[] pills = _pills.GetComponentsInChildren <Transform>(); foreach (Transform t in pills) { if (t.gameObject.tag == "Pellet") { t.gameObject.SetActive(true); } } Transform[] big_ills = _big_pills.GetComponentsInChildren <Transform>(); foreach (Transform t in big_ills) { if (t.gameObject.tag == "Super Pellet") { t.gameObject.SetActive(true); } } _finished = false; }
void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Pellet") { other.gameObject.SetActive(false); _score += PELLET_POINTS; SetCountText(); } else if (other.gameObject.tag == "Super Pellet") { Transform[] ghosts = _ghosts.GetComponentsInChildren <Transform>(); foreach (Transform g in ghosts) { if (g.gameObject.tag != "Ghost" && g.gameObject.tag != "Player") { continue; } GhostAI g_ai = g.gameObject.GetComponent <GhostAI>(); g_ai.SetVulnerable(); other.gameObject.SetActive(false); } Startup start_up = _floor.GetComponent <Startup>(); start_up.StartChomp(); } else if (other.gameObject.tag == "Pen Gate") { if (_direction == Movement.Direction.Down) { _direction = Movement.Direction.Left; } } else { Movement.SwitchDirection(Movement.Randomize(), 0, transform.position, ref _direction); } }
// Token: 0x060006E2 RID: 1762 RVA: 0x00027C78 File Offset: 0x00025E78 public FavouriteRoomState(GhostAI ghostAI, NavMeshAgent agent) { this.ghostAI = ghostAI; this.agent = agent; }
// Start is called before the first frame update void Start() { ai = gameObject.GetComponent <GhostAI>(); gate = GameObject.Find("Gate(Clone)"); pacMan = GameObject.Find("PacMan(Clone)") ? GameObject.Find("PacMan(Clone)") : GameObject.Find("PacMan 1(Clone)"); }
// Use this for initialization void Start () { escapeZone.SetActive (false); ghost = GameObject.FindObjectOfType<GhostAI> (); }
public async Task LoadObjectsTask() { string curSceneName = SceneManager.GetActiveScene().name.ToLower(); while (!curSceneName.Contains("menu") && !curSceneName.Contains("new")) { await Task.Delay(4000); if (SceneManager.sceneLoaded != null) { Main.gameController = GameObject.FindObjectOfType <GameController>(); await Task.Delay(150); Main.levelController = GameObject.FindObjectOfType <LevelController>(); await Task.Delay(150); Main.levelSelectionManager = GameObject.FindObjectOfType <LevelSelectionManager>(); await Task.Delay(150); Main.walkieTalkie = GameObject.FindObjectOfType <WalkieTalkie>(); await Task.Delay(150); Main.handCamera = GameObject.FindObjectOfType <HandCamera>(); await Task.Delay(150); Main.inventoryManager = GameObject.FindObjectOfType <InventoryManager>(); await Task.Delay(150); Main.liftButton = GameObject.FindObjectOfType <LiftButton>(); await Task.Delay(150); Main.contract = GameObject.FindObjectOfType <Contract>(); await Task.Delay(150); Main.pCMenu = GameObject.FindObjectOfType <PCMenu>(); await Task.Delay(150); Main.exitLevel = GameObject.FindObjectOfType <ExitLevel>(); await Task.Delay(150); Main.ghostAI = GameObject.FindObjectOfType <GhostAI>(); await Task.Delay(150); Main.lightSwitch = GameObject.FindObjectOfType <LightSwitch>(); await Task.Delay(150); Main.light = GameObject.FindObjectOfType <Light>(); await Task.Delay(150); Main.dNAEvidences = Enumerable.ToList <DNAEvidence>(GameObject.FindObjectsOfType <DNAEvidence>()); await Task.Delay(150); Main.contracts = Enumerable.ToList <Contract>(GameObject.FindObjectsOfType <Contract>()); await Task.Delay(150); Main.items = Enumerable.ToList <InventoryItem>(GameObject.FindObjectsOfType <InventoryItem>()); await Task.Delay(150); Main.players = Enumerable.ToList <Player>(GameObject.FindObjectsOfType <Player>()); await Task.Delay(150); Main.photonView = GameObject.FindObjectOfType <PhotonView>(); await Task.Delay(150); Main.ghostInfo = GameObject.FindObjectOfType <GhostInfo>(); await Task.Delay(150); Main.deadPlayer = GameObject.FindObjectOfType <DeadPlayer>(); await Task.Delay(150); Main.player = GameObject.FindObjectOfType <Player>(); await Task.Delay(150); Main.rigidbody = GameObject.FindObjectOfType <Rigidbody>(); await Task.Delay(150); Main.itemSpawner = GameObject.FindObjectOfType <ItemSpawner>(); await Task.Delay(150); Main.ghostInteraction = GameObject.FindObjectOfType <GhostInteraction>(); await Task.Delay(150); //Main.baseController = GameObject.FindObjectOfType<BaseController>(); await Task.Delay(150); Main.ouijaBoard = GameObject.FindObjectOfType <OuijaBoard>(); await Task.Delay(150); Main.ouijaBoards = Enumerable.ToList <OuijaBoard>(GameObject.FindObjectsOfType <OuijaBoard>()); await Task.Delay(150); Main.keys = Enumerable.ToList <Key>(GameObject.FindObjectsOfType <Key>()); await Task.Delay(150); Main.ghosts = Enumerable.ToList <GhostAI>(GameObject.FindObjectsOfType <GhostAI>()); await Task.Delay(150); Main.serverManager = GameObject.FindObjectOfType <ServerManager>(); await Task.Delay(150); Main.torches = Enumerable.ToList <Torch>(GameObject.FindObjectsOfType <Torch>()); await Task.Delay(150); Main.ghostAudio = GameObject.FindObjectOfType <GhostAudio>(); await Task.Delay(150); Main.fuseBox = GameObject.FindObjectOfType <FuseBox>(); await Task.Delay(150); Main.doors = Enumerable.ToList <Door>(GameObject.FindObjectsOfType <Door>()); await Task.Delay(150); Main.lightSwitches = Enumerable.ToList <LightSwitch>(GameObject.FindObjectsOfType <LightSwitch>()); } } }
public override void execute (GhostAI ghost) { }
} // Dummy constructor public u091Cu091Fu0925u0924u0924u0922u0920u091Fu0920u0928u091E(GhostAI ghostAI, GhostInteraction ghostInteraction, GhostAudio ghostAudio, NavMeshAgent agent, LayerMask mask) { } // 0x0000000180E8A580-0x0000000180E8A610
} // Dummy constructor public u0921u091Du091Bu091Eu0925u0926u0923u0923u091Du0923u0924(GhostAI ghostAI, GhostInteraction ghostInteraction) { } // 0x0000000180294750-0x00000001802947A0
public override void exit (GhostAI ghost) { Debug.Log("....State exit executed"); base.exit(ghost); }
// Token: 0x060006B6 RID: 1718 RVA: 0x000256A8 File Offset: 0x000238A8 public AppearState(GhostAI ghostAI, NavMeshAgent agent) { this.ghostAI = ghostAI; this.agent = agent; }
// Token: 0x06000722 RID: 1826 RVA: 0x00029F0B File Offset: 0x0002810B public WindowKnockState(GhostAI ghostAI, GhostInteraction ghostInteraction, PhotonObjectInteract obj) { this.ghostAI = ghostAI; this.ghostInteraction = ghostInteraction; this.window = obj.GetComponent <Window>(); }
void Start () { ghostAI = GameObject.Find("Ghost").GetComponent<GhostAI>(); }
// Token: 0x060006F5 RID: 1781 RVA: 0x000295C7 File Offset: 0x000277C7 public KillPlayerState(GhostAI ghostAI, NavMeshAgent agent, PhotonView view) { this.ghostAI = ghostAI; this.agent = agent; this.view = view; }
public void setGhostNumber( int num ) { this.ghostNumber = num; GhostAIFactory ghostFactory = new GhostAIFactory( GameObject.FindObjectsOfType<PacmanData>(), Board ); AI = ghostFactory.getGhostByNumber( num, Data ); IntVector2 spawn = Board.GetGhostSpawn( num ); this.Data.boardLocation = new BoardLocation( spawn, new IntVector2(0, 0 ) ); this.Data.lastBoardLocation = this.Data.boardLocation.Clone(); }