public async Task <IHttpActionResult> PutPlayerMaster(PlayerMaster playerMaster) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } playerMaster.UpdateDate = DateTime.Now; db.Entry(playerMaster).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PlayerMasterExists(playerMaster.PlayerID)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public void Interact(PlayerMaster player) { if (interactable) { CutSceneLoadLink.instance.StartCutScene(levelIndex, player); } }
public PlayerMechanics(PlayerMaster _master, InputController _input, PlayerInteraction _interaction, Toolbar _toolbar) { master = _master; input = _input; toolbar = _toolbar; interaction = _interaction; }
// Changes the phase and updates the UI as needed public static IEnumerator ChangeTurn() { UIMaster.SetActionPanel(false); yield return(AlterState()); // pauses before executing the rest of the code based on phase. if (PlayerMaster.PriorTurn == 0) { yield return(EndofRound()); } if (gP != GamePhase.Attack) { PlayerMaster.SwitchPlayer(); TopDownCamera.ChangePlayerCamera(); } UIMaster.ChangeDisplayedPlayer(); UIMaster.ChangePlayerDeploy(gP); UIMaster.DisplayState(gP, PlayerMaster.CurrentTurn); turnNum++; yield return(null); }
public void Interact(PlayerMaster player) { foreach (PlanetSelectorPlanet planet in planets) { planet.Toggle(); } }
public void Interact(PlayerMaster player) { if (carried) { Drop(); } else { target = player.GetPlayerInteraction(); carried = true; target.carrying = true; if (spherePhys) { //temp, this is also not quite right it would be nice for object to keep rotating gb.enabled = false; } else { rb.useGravity = false; } targetTrans = player.GetPlayerCameraTransform(); offset = Vector3.Distance(transform.position, targetTrans.position); rb.collisionDetectionMode = CollisionDetectionMode.Continuous; rb.velocity = Vector3.zero; rb.freezeRotation = true; sceneObj.SetTransform(); } }
// Use this for initialization void Start() { movePos = new Vector2(); player = transform; tileMap = GameObject.FindGameObjectWithTag("MasterTiles").GetComponent <Tilemap>(); playerMaster = GetComponent <PlayerMaster>(); waitTime = Time.time; }
public override void Activate(PlayerMaster master) { //needs the camera transform particlesInstance = Object.Instantiate(particlesPrefab, Camera.main.gameObject.transform); particlesInstance.transform.localPosition = offset; system = particlesInstance.GetComponent <ParticleSystem>(); system.Stop(); }
public void Interact(PlayerMaster player) { on = true; foreach (DanceSpider spider in spiders) { spider.Prepare(); } }
// Use this for initialization void Start() { _motor = GetComponent<PlatformerMotor2D>(); _eMaster = GetComponent<EnemyAIMaster>(); _animator = GetComponent<Animator>(); EH = GetComponent<EnemyHealth>(); _pMaster = _eMaster._pMaster; }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "Player") { Debug.Log("BulletHit"); PlayerMaster player = collision.GetComponent <PlayerMaster>(); player.GetHit(transform.position); } }
// Start is called before the first frame update void Start() { playerContentUI = this.transform.GetChild(0); playerClampsUI = this.transform.GetChild(1); clampImage = playerClampsUI.GetComponent <Image>(); clampImage.sprite = clampSpriteClosed; contentImage = playerContentUI.GetComponent <Image>(); player = GameObject.Find("PlayerController").GetComponent <PlayerMaster>(); UpdateContentImage(); }
void SetInitialReferences() { platformMaster = GetComponent <PlatformMaster>(); player = GameObject.FindGameObjectWithTag(playerTag); destructor = GameObject.FindGameObjectWithTag(destructorTag); playerMaster = player.GetComponent <PlayerMaster>(); destructorMaster = destructor.GetComponent <DestructorMaster>(); }
public PlayerMaster() { currentTurn = 0; priorTurn = 1; players = new Player[2] { new Player(Quaternion.Euler(60, 180, 0)), new Player(Quaternion.Euler(55, 0, 0)) }; instance = this; soundM = GameObject.Find("SoundMaster").GetComponent <SoundMaster>(); }
public void StartCutScene(int index, PlayerMaster player) { sceneToLoad = index; director.Play(); cutsceneCam.enabled = true; player.DeActivatePlayer(); }
public static void SwapPoints(UnitTypes uT, int from) { int amt = pointValues[(int)uT]; PlayerMaster.UnitsPlayer(from).Score -= amt; PlayerMaster.UnitsPlayer(from == 0 ? 1 : 0).Score += amt; instance.score1 = PlayerMaster.UnitsPlayer(0).Score; instance.score2 = PlayerMaster.UnitsPlayer(1).Score; UIMaster.DisplayScore(); }
public PlayerInteraction(PlayerMaster _master, InputController _input, PlayerCamera _camera, Inventory _inv) { master = _master; input = _input; camera = _camera; inv = _inv; interactRay = new Ray(camera.camInstance.transform.position, camera.camInstance.transform.forward); }
public async Task <IHttpActionResult> GetPlayerMaster(int id) { PlayerMaster playerMaster = await db.PlayerMaster.FindAsync(id); if (playerMaster == null) { return(NotFound()); } return(Ok(playerMaster)); }
public void SpawnInWorld() { //remove from inv //this will need to change InventoryPanel.Instance.inventory.RemoveSampleAt(curSlotTransform.GetComponent <SlotData>().SlotIndex); //finding component for player isn't great PlayerMaster player = gameObject.GetComponentInParent <PlayerMaster>(); SampleBehaviour.SpawnInWorld(sample, player.transform.position + player.transform.forward); }
public static void GivePoints(int amt, int p) { PlayerMaster.UnitsPlayer(p).Score += amt; if (p == 0) { instance.score1 = PlayerMaster.UnitsPlayer(p).Score; } else { instance.score2 = PlayerMaster.UnitsPlayer(p).Score; } }
public async Task <IHttpActionResult> DeletePlayerMaster(int id) { PlayerMaster playerMaster = await db.PlayerMaster.FindAsync(id); if (playerMaster == null) { return(NotFound()); } db.PlayerMaster.Remove(playerMaster); await db.SaveChangesAsync(); return(Ok(playerMaster)); }
// Update is called once per frame void Update() { if (checkUnits && unitsFalling == 0) //If we need to check the units and all of said units have finished falling (Brennan) { for (int i = unitList.Count - 1; i > -1; --i) //You have to move backwards through a list if you remove from it while iterating through it (Brennan) { if (unitList[i] != null) { if (unitList[i].tag == "Infantry") //If it's an Infantry we get the Infantry script { if (unitList[i].GetComponent <Infantry>().dead) { //Unit tR = unitList[i].GetComponent<Unit>(); //ScoreMaster.UpdateScore(tR); //DeleteUnitFromPlay(tR); //Destroy(unitList[i]); //unitList.Remove(unitList[i]); PlayerMaster.KillUnit(unitList[i].GetComponent <Unit>()); } } else { if (unitList[i].GetComponent <Cavalry>().dead) { /* Unit tR = unitList[i].GetComponent<Unit>(); * ScoreMaster.UpdateScore(tR); * DeleteUnitFromPlay(tR); * Destroy(unitList[i]); * unitList.Remove(unitList[i]);*/ PlayerMaster.KillUnit(unitList[i].GetComponent <Unit>()); } } } } for (int i = 0; i < unitList.Count; ++i) { if (unitList[i] != null) { unitList[i].transform.position = unitList[i].GetComponent <Unit>().CurrentHex.SpawnVector; unitList[i].transform.rotation = unitList[i].GetComponent <Unit>().URotation(); unitList[i].GetComponent <Rigidbody>().velocity = Vector3.zero; unitList[i].GetComponent <Rigidbody>().angularVelocity = Vector3.zero; } } unitList.Clear(); checkUnits = false; } }
public async Task <IHttpActionResult> PostPlayerMaster(PlayerMaster playerMaster) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } playerMaster.UpdateDate = DateTime.Now; playerMaster.InsertDate = DateTime.Now; playerMaster.UseFlag = true; db.PlayerMaster.Add(playerMaster); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = playerMaster.PlayerID }, playerMaster)); }
public Archer newArcher(PlayerMaster owner) { if(owner.playerNumber == 0) { tag = "PlayerOne"; } else { tag = "PlayerTwo"; } cost = 3; moveRange = 3; attackRange = 5; damage = 3; team = owner; state = true; type = unitType.Archer; health = 3; return this; }
void Awake() { joy = joystick.GetComponent<Joystick> (); _pM = GetComponentInParent<PlayerMaster> (); _animator = GetComponentInParent<Animator>(); trajectoryPoints = new List<GameObject>(); isPressed = isSpearThrown = false; arm.GetComponent<Renderer>().enabled = false; // aRend = arm.GetComponent<SpriteRenderer> (); //sRend = spearghost.GetComponent<SpriteRenderer> (); // sRend.color = clearColour; // aRend.color = clearColour; // sRend.enabled = false; // aRend.enabled = false; }
private async Task <List <PlayListLinkData> > GetTotalPlayListByPlayerID(int PlayerID) { PlayerMaster pm = db.PlayerMaster.Find(PlayerID); List <int> GroupIDList = new List <int>(); GroupIDList.Add((int)pm.GroupID); PublicMethods.GetParentGroupIDs((int)pm.GroupID, ref GroupIDList, db); int[] groupIDs = GroupIDList.ToArray <int>(); string groupIDsStr = string.Join(",", groupIDs.Select(i => i.ToString()).ToArray()); List <PlayListLinkData> pldList = (from plm in db.PlayListMaster join gplt in db.GroupPlayListLinkTable on plm.PlayListID equals gplt.PlayListID join gm in db.GroupMaster on plm.GroupID equals gm.GroupID into ProjectV from pv in ProjectV.DefaultIfEmpty() where groupIDs.Contains((int)gplt.GroupID) && plm.UseFlag == true orderby groupIDsStr.IndexOf(gplt.GroupID.ToString()) descending, gplt.Index select new PlayListLinkData { PlayListID = plm.PlayListID, PlayListName = plm.PlayListName, Settings = plm.Settings, UpdateDate = (DateTime)plm.UpdateDate, GroupID = (int)plm.GroupID, GroupName = pv.GroupName, BindGroupID = (int)gplt.GroupID, Index = (int)gplt.Index }).ToList(); pldList.AddRange((from plm in db.PlayListMaster join pplt in db.PlayerPlayListLinkTable on plm.PlayListID equals pplt.PlayListID join gm in db.GroupMaster on plm.GroupID equals gm.GroupID into ProjectV from pv in ProjectV.DefaultIfEmpty() where pplt.PlayerID == PlayerID && plm.UseFlag == true orderby pplt.Index select new PlayListLinkData { PlayListID = plm.PlayListID, PlayListName = plm.PlayListName, Settings = plm.Settings, UpdateDate = (DateTime)plm.UpdateDate, GroupID = (int)plm.GroupID, GroupName = pv.GroupName, Index = (int)pplt.Index }).ToList()); return(pldList); }
public Cannon newCannon(PlayerMaster owner) { if(owner.playerNumber == 0) { tag = "PlayerOne"; } else { tag = "PlayerTwo"; } cost = 5; moveRange = 2; attackRange = 10; damage = 5; team = owner; state = true; type = unitType.Cannon; health = 10; return this; }
public Soldier newSoldier(PlayerMaster owner) { if(owner.playerNumber == 0) { tag = "PlayerOne"; } else { tag = "PlayerTwo"; } cost = 2; moveRange = 5; attackRange = 1; damage = 1; team = owner; state = true; type = unitType.Soldier; health = 5; //gui.Find("GUI"); return this; }
// changes the phase and "refreshes" variables as apropriate static IEnumerator EndofRound() { switch (gP) { case (GamePhase.Deploy): Debug.Log("Move from D"); MoveMaster.PrimeMoveVariables(PlayerMaster.OtherPlayer); PlayerMaster.RefreshMovement(); HighlightMaster.HighlightMovable(PlayerMaster.OtherPlayer); gP = GamePhase.Move; break; case (GamePhase.Cannon): Debug.Log("Move from C"); PlayerMaster.RefreshMovement(); if (PlayerMaster.CurrentTurn == 1) { MoveMaster.PrimeMoveVariables(PlayerMaster.OtherPlayer); HighlightMaster.HighlightMovable(PlayerMaster.OtherPlayer); } gP = GamePhase.Move; break; case (GamePhase.Move): Debug.Log("Cannon from M"); HighlightMaster.HighlightActiveCannons(PlayerMaster.OtherPlayer); yield return(WinBySize()); gP = GamePhase.Cannon; //CheckSkip(); break; case (GamePhase.Attack): Debug.Log("Move from A"); break; default: yield return(null); break; } }
//initialize void Start() { instance = this; // canSkip = false; uiM = new UIMaster(); sM = new ScoreMaster(); mM = new MapMaster(); pM = new PlayerMaster(); dM = new DeployMaster(); mvM = new MoveMaster(); aM = new AttackMaster(); acceptInput = true; turnNum = 0; CannonMaster.ResetCurrent(); gP = GamePhase.Deploy; ScoreMaster.ResetScore(); mL = new MapLoader(); mL.LoadMapFromTextAsset(((TextAsset)Resources.Load("Maps/" + mapName))); PlayerMaster.SetBackLines(MapMaster.Map); TopDownCamera.ActivateMainCamera(MapMaster.Height, MapMaster.Width, MapMaster.MapRadius); UIMaster.SetGeneralUI(); UIMaster.SetDeployUI(); UIMaster.SetCannonUI(); UIMaster.DisplayScore(); UIMaster.SetPanelAlpha(false, (int)UIPannels.Cannon); UIMaster.SetPanelAlpha(false, (int)UIPannels.Phase); UIMaster.SetPanelAlpha(false, (int)UIPannels.View); UIMaster.SetPanelAlpha(false, (int)UIPannels.Fight); UIMaster.SetActionPanel(true); if (!tutorial) { UIMaster.DisplayState(gP, PlayerMaster.CurrentTurn); } // norton = VS_AI ? new AIBrain() : null; // must be called after UIMaster.SetGeneralUI to percive turns properly }
public void Interact(PlayerMaster player) { player.GetPlayerMechanics().AddMechanic(mechanicId); GetComponent <SceneObject>().DestroySceneObj(); }
public void Interact(PlayerMaster player) { //Craft combiner.CombineSamples(); }
static IEnumerator Fight() //Handles and manages the FightScene { gP = GamePhase.Attack; while (AttackMaster.CombatCount != 0) { float rotation; if (PlayerMaster.CurrentTurn == 0) { rotation = 180; } else { rotation = 0; } instance.StartCoroutine(TopDownCamera.LerpToPosition(AttackMaster.CenterOfCombat(), Quaternion.Euler(90, rotation, 0))); yield return(new WaitForSeconds(2.0f)); //Wait to give the player a chance to see stuff instance.StartCoroutine(UIMaster.MoveCurtains(true)); //lower curtains yield return(null); //Wait at least one frame so that UIMaster.MovingCurtians can change value while (UIMaster.MovingCurtains) { yield return(null); } List <Unit> currentCombat = AttackMaster.CurrentCombatArea; List <Unit> toKill = AttackMaster.FightResults(); FightSceneMaster.SetUpFight(currentCombat, toKill); //Prepare the fightscene yield return(new WaitForSeconds(1.0f)); //Pause for dramatic effect instance.StartCoroutine(UIMaster.MoveCurtains(false)); //Raise Curtains yield return(null); while (UIMaster.MovingCurtains) { yield return(null); } SoundMaster.AttackCharge(); instance.StartCoroutine(FightSceneMaster.ToBattle()); //Begins FightScene yield return(null); //Wait at least one frame so that FightSceneMaster.Fighting can change value while (FightSceneMaster.Fighting) { yield return(null); } //SoundMaster.AttackResolution(); instance.StartCoroutine(UIMaster.MoveCurtains(true)); //Lower curtains again yield return(null); //Wait at least one frame so that UIMaster.MovingCurtians can change value while (UIMaster.MovingCurtains) { yield return(null); } FightSceneMaster.CleanUp(); //Resets FightScene yield return(new WaitForSeconds(0.25f)); //Pause instance.StartCoroutine(UIMaster.MoveCurtains(false)); //Raise curtains yield return(new WaitForFixedUpdate()); //Wait at least one frame so that UIMaster.MovingCurtians can change value while (UIMaster.MovingCurtains) { yield return(null); } yield return(new WaitForSeconds(1.0f)); foreach (Unit u in toKill) { PlayerMaster.KillUnit(u); //Kills dead units } yield return(new WaitForSeconds(1.0f)); //Pause to see aftermath } //return to player's position after the fight instance.StartCoroutine(TopDownCamera.LerpToPosition(PlayerMaster.CurrentPlayer.CameraPosistion, PlayerMaster.CurrentPlayer.CameraRotation)); DeactivateCannonByMove(PlayerMaster.OtherPlayer); if (PlayerMaster.CurrentTurn == 0) { HighlightMaster.HighlightMovable(PlayerMaster.OtherPlayer); } UIMaster.DisplayScore(); // WinByMove(); UIMaster.SetActionPanel(true); //Turns action pannel back on UIMaster.FadePhanel((int)UIPannels.Action); CannonMaster.CheckCannonCapture(); gP = GamePhase.Move; yield return(ChangeTurn()); acceptInput = true; }
void Awake() { EH = GetComponent<EnemyHealth>(); stopDist = 1.5f; _canAttack = true; _motor = GetComponent<PlatformerMotor2D>(); _anim = GetComponent<EnemyAIAnimator>(); _hero = PlayerPrefs.GetInt("Hero"); AI = this.gameObject; //Determine which hero to look for and go after; switch (_hero) { case 0: Debug.Log("I am from Ionia"); target = GameObject.FindGameObjectWithTag("Ionian"); targetT = target.transform; IS = target.GetComponent<IonianStatistics>(); IH = target.GetComponent<IonianHealth>(); IXP = target.GetComponent<IonianEXP>(); _pMaster = target.GetComponent<PlayerMaster>(); break; case 1: Debug.Log("I am from Athens"); target = GameObject.FindGameObjectWithTag("Athenian"); targetT = target.transform; ATS = target.GetComponent<AthenianStatistics>(); ATH = target.GetComponent<AthenianHealth>(); ATXP = target.GetComponent<AthenianEXP>(); _pMaster = target.GetComponent<PlayerMaster>(); break; case 2: Debug.Log("I am from Sparta"); target = GameObject.FindGameObjectWithTag("Spartan"); targetT = target.transform; SS = target.GetComponent<SpartanStatistics>(); SH = target.GetComponent<SpartanHealth>(); SXP = target.GetComponent<SpartanEXP>(); _pMaster = target.GetComponent<PlayerMaster>(); break; case 3: Debug.Log("I am Greek"); target = GameObject.FindGameObjectWithTag("Achilles"); targetT = target.transform; AS = target.GetComponent<AchillesStatistics>(); AH = target.GetComponent<AchillesHealth>(); AXP = target.GetComponent<AchillesEXP>(); _pMaster = target.GetComponent<PlayerMaster>(); break; } }
// Start is called before the first frame update void Start() { nma = GetComponent <NavMeshAgent>(); master = GetComponent <PlayerMaster>(); }
void Awake() { #region TOUCH VARIABLE DECLARATION #if !UNITY_ANDROID && !UNITY_IPHONE && !UNITY_BLACKBERRY && !UNITY_WINRT || UNITY_EDITOR //nothing specific for Unity PC. This was just to get rid of touch variables when not needed; #else //Screen With for swipe controls mid = Screen.width / 2.0f; #endif #endregion _hero = PlayerPrefs.GetInt("Hero"); _master = GetComponent<PlayerMaster>(); _motor = GetComponent<PlatformerMotor2D>(); }
private void Start() { player = GetComponent <PlayerMaster>(); }
void Awake() { int _hero = PlayerPrefs.GetInt("Hero"); arm.GetComponent<Renderer>().enabled = false; _pM = GetComponentInParent<PlayerMaster>(); Me = GetComponentInParent<Transform>(); if (_hero == 2) { trajectoryPoints = new List<GameObject>(); for (int i = 0; i < numOfTrajectoryPoints; i++) { GameObject dot = (GameObject)Instantiate(TrajectoryPointPrefeb); dot.GetComponent<Renderer>().enabled = false; trajectoryPoints.Insert(i, dot); } } }
void Start () { playerMaster = this; }