private void killPlayer(HERO hero) { if (hero != null) { Vector3 position = baseT.Find("Amarture/Core/Controller_Body/hip/spine/chest").position; if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { if (!hero.HasDied()) { hero.die((Vector3)(((hero.transform.position - position) * 15f) * 4f), false); } } else if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.MULTIPLAYER) { if (FengGameManagerMKII.LAN) { if (!hero.HasDied()) { hero.markDie(); } } else if (!hero.HasDied()) { hero.markDie(); object[] parameters = new object[] { (Vector3)(((hero.transform.position - position) * 15f) * 4f), false, -1, "Colossal Titan", true }; hero.photonView.RPC("netDie", PhotonTargets.All, parameters); } } } }
private GameObject checkIfHitHand(Transform hand) { foreach (Collider collider in Physics.OverlapSphere(hand.GetComponent <SphereCollider>().transform.position, 31f)) { if (collider.transform.root.tag == "Player") { GameObject gameObject = collider.transform.root.gameObject; TITAN_EREN te = gameObject.GetComponent <TITAN_EREN>(); if (te != null) { if (!te.isHit) { te.hitByTitan(); } return(gameObject); } HERO he = gameObject.GetComponent <HERO>(); if ((he != null) && !he.isInvincible()) { return(gameObject); } } } return(null); }
// Deadly hooks private void HandleHookToObj(int viewId) { PhotonView pv = PhotonView.Find(viewId); if (pv == null || !Guardian.Mod.Properties.DeadlyHooks.Value || !PhotonNetwork.isMasterClient) { return; } HERO hero = pv.gameObject.GetComponent <HERO>(); if (hero == null || hero.HasDied()) { return; } string killer = GExtensions.AsString(photonView.owner.customProperties[PhotonPlayerProperty.Name]); if (killer.StripNGUI().Length < 1) { killer = "Player"; } killer += $" [FFCC00]({photonView.owner.Id})[FFFFFF]"; hero.MarkDead(); hero.photonView.RPC("netDie2", pv.owner, -1, $"{killer}'s hook"); }
public override void Apply() { HERO hero = Owner.GetComponent <HERO>(); foreach (KeyValuePair <int, Renderer[]> pair in renderers) { if (pair.Key == (int)HumanParts.Gas && Configuration.SkinSettings.DisableCustomGas.Value) { continue; } SkinElement skin = elements[pair.Key]; if (skin.IsDone && pair.Value != null) { foreach (Renderer render in pair.Value) { if (skin.IsTransparent) { render.enabled = false; continue; } if (hero.Setup.myCostume.hairInfo.id >= 0) { render.material = CharacterMaterials.Materials[hero.Setup.myCostume.hairInfo.texture]; } if (pair.Key == (int)HumanParts.Eyes || pair.Key == (int)HumanParts.Glass || pair.Key == (int)HumanParts.Face) { render.material.mainTextureScale *= 8f; render.material.mainTextureOffset = new Vector2(0f, 0f); } render.material.mainTexture = skin.Texture; } } } }
public void CameraMovementLive(HERO hero) { float magnitude = hero.rigidbody.velocity.magnitude; if (magnitude > 10f) { Camera.main.fieldOfView = Mathf.Lerp(Camera.main.fieldOfView, Mathf.Min((float)100f, (float)(magnitude + 40f)), 0.1f); } else { Camera.main.fieldOfView = Mathf.Lerp(Camera.main.fieldOfView, 50f, 0.1f); } float num2 = (hero.CameraMultiplier * (200f - Camera.main.fieldOfView)) / 150f; base.transform.position = (Vector3)((this.head.transform.position + (Vector3.up * this.heightMulti)) - ((Vector3.up * (0.6f - cameraDistance)) * 2f)); Transform transform = base.transform; transform.position -= (Vector3)(((base.transform.forward * this.distance) * this.distanceMulti) * num2); if (hero.CameraMultiplier < 0.65f) { Transform transform2 = base.transform; transform2.position += (Vector3)(base.transform.right * Mathf.Max((float)((0.6f - hero.CameraMultiplier) * 2f), (float)0.65f)); } base.transform.rotation = Quaternion.Lerp(Camera.main.transform.rotation, hero.GetComponent <SmoothSyncMovement>().correctCameraRot, Time.deltaTime * 5f); }
private void OnTriggerStay(Collider other) { if (other.gameObject.tag == "Player") { switch (type) { case BottomType.Die: HERO hero = other.gameObject.GetComponent <HERO>(); if (hero != null && !hero.HasDied()) { if (IN_GAME_MAIN_CAMERA.Gametype == GameType.Singleplayer) { hero.Die(other.gameObject.rigidbody.velocity * 50f, false); } else if (hero.photonView.isMine) { hero.NetDieLocal2(other.gameObject.rigidbody.velocity * 50f, false, -1, Guardian.Mod.Properties.LavaDeathMessage.Value, true); } } break; case BottomType.Teleport: other.gameObject.transform.position = link != null ? link.transform.position : Vector3.zero; break; } } }
public override void Execute(InRoomChat irc, string[] args) { if (args.Length > 0 && int.TryParse(args[0], out int id)) { PhotonPlayer player = PhotonPlayer.Find(id); if (player != null) { if (GameHelper.IsPT(player)) { TITAN titan = GameHelper.GetPT(player); if (titan != null) { titan.photonView.RPC("titanGetHit", player, titan.photonView.viewID, 10); } } else { HERO hero = GameHelper.GetHero(player); if (hero != null) { hero.photonView.RPC("netDie", PhotonTargets.All, hero.transform.position, false, -1, "[FF0000]Server", true); } } } } }
public void launchDashNets(Vector3 v, Vector3 v2, GameObject hero, HERO victimHero) { this.master = hero; this.masterT = this.master.transform; this.masterR = this.master.rigidbody; this.MasterHero = hero.GetComponent <HERO>(); this.velocity = v; this.velocity2 = Vector3.Project(v2, v); this.myRef = this.MasterHero.hookRefR1; this.myRefT = this.MasterHero.hookRefR1.transform; this.nodes = new ArrayList() { this.myRefT.position }; this.phase = 0; object[] parameters = new object[] { this.MasterHero.photonView.viewID, "hookRefR1" }; basePV.RPC("myMasterIs", PhotonTargets.Others, parameters); object[] objArray2 = new object[] { v, velocity2, false }; basePV.RPC("setVelocityAndLeft", PhotonTargets.Others, objArray2); object[] objArray3 = new object[] { victimHero.photonView.viewID }; basePV.RPC("tieMeToOBJ", PhotonTargets.Others, objArray3); MasterHero.hookToHuman(victimHero.gameObject, baseT.position, true); //baseT.parent = victimHero.transform; baseT.position = this.myRefT.position; baseT.rotation = Quaternion.LookRotation(v.normalized); object[] objArray4 = new object[] { 0 }; basePV.RPC("setPhase", PhotonTargets.Others, objArray4); }
public override void Execute(InRoomChat irc, string[] args) { if (args.Length < 1 || !int.TryParse(args[0], out int id)) { return; } PhotonPlayer player = PhotonPlayer.Find(id); if (player == null) { return; } if (player.IsTitan) { TITAN titan = player.GetTitan(); if (titan == null || titan.hasDie) { return; } titan.photonView.RPC("titanGetHit", player, titan.photonView.viewID, RCSettings.MinimumDamage > 0 ? RCSettings.MinimumDamage : 10); } else { HERO hero = player.GetHero(); if (hero == null || hero.HasDied()) { return; } hero.photonView.RPC("netDie", PhotonTargets.All, hero.transform.position, false, -1, "[FF0000]Server", true); } }
public override void Execute(InRoomChat irc, string[] args) { if (args.Length < 1) { return; // Disallow blank names } string name = string.Join(" ", args); LoginFengKAI.Player.Name = name; FengGameManagerMKII.NameField = name; PhotonNetwork.player.SetCustomProperties(new ExitGames.Client.Photon.Hashtable { { PhotonPlayerProperty.Name, name } }); HERO hero = PhotonNetwork.player.GetHero(); if (hero == null) { return; } FengGameManagerMKII.Instance.photonView.RPC("labelRPC", PhotonTargets.All, new object[] { hero.photonView.viewID }); }
private void myMasterIs(int id, string launcherRef) { PhotonView pv = PhotonView.Find(id); if (pv == null) { return; } if (pv.gameObject != null) { master = pv.gameObject.GetComponent <HERO>(); } switch (launcherRef) { case "hookRefL1": this.myRef = this.master.hookRefL1; break; case "hookRefL2": this.myRef = this.master.hookRefL2; break; case "hookRefR1": this.myRef = this.master.hookRefR1; break; case "hookRefR2": this.myRef = this.master.hookRefR2; break; } if (myRef != null && myRef) { myRefT = myRef.transform; } }
public void CameraMovementLive(HERO hero) { var magnitude = hero.rigidbody.velocity.magnitude; if (magnitude > 10f) { Camera.main.fieldOfView = Mathf.Lerp(Camera.main.fieldOfView, Mathf.Min(100f, magnitude + 40f), 0.1f); } else { Camera.main.fieldOfView = Mathf.Lerp(Camera.main.fieldOfView, 50f, 0.1f); } var num2 = hero.CameraMultiplier * (200f - Camera.main.fieldOfView) / 150f; this.transform.position = head.transform.position + Vector3.up * heightMulti - Vector3.up * (0.6f - cameraDistance) * 2f; var transform = this.transform; transform.position -= this.transform.forward * distance * distanceMulti * num2; if (hero.CameraMultiplier < 0.65f) { var transform2 = this.transform; transform2.position += this.transform.right * Mathf.Max((0.6f - hero.CameraMultiplier) * 2f, 0.65f); } this.transform.rotation = Quaternion.Lerp(Camera.main.transform.rotation, hero.GetComponent <SmoothSyncMovement>().correctCameraRot, Time.deltaTime * 5f); }
private void hitPlayer(HERO heros) { if ((!heros.HasDied()) && !heros.isInvincible()) { if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { if (!heros.isGrabbed) { heros.die((Vector3)((this.v.normalized * 1000f) + (Vector3.up * 50f)), false); } } else if (((IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.MULTIPLAYER) && !heros.HasDied()) && !heros.isGrabbed) { heros.markDie(); int myOwnerViewID = -1; string titanName = string.Empty; EnemyfxIDcontainer fx = baseT.root.gameObject.GetComponent <EnemyfxIDcontainer>(); if (fx != null) { myOwnerViewID = fx.myOwnerViewID; titanName = fx.titanName; } Debug.Log("rock hit player " + titanName); object[] parameters = new object[] { (Vector3)((this.v.normalized * 1000f) + (Vector3.up * 50f)), false, myOwnerViewID, titanName, true }; heros.photonView.RPC("netDie", PhotonTargets.All, parameters); } } }
private void hitPlayer(GameObject go) { HERO hero = go.GetComponent <HERO>(); if (hero != null && !hero.HasDied() && !hero.IsInvincible()) { if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single) { if (!hero.isGrabbed) { hero.die(this.v.normalized * 1000f + Vectors.up * 50f, false); } } else if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer && !hero.HasDied() && !hero.isGrabbed) { hero.markDie(); int num = -1; string text = string.Empty; if (baseT.root.gameObject.GetComponent <EnemyfxIDcontainer>() != null) { num = baseT.root.gameObject.GetComponent <EnemyfxIDcontainer>().myOwnerViewID; text = baseT.root.gameObject.GetComponent <EnemyfxIDcontainer>().titanName; } hero.BasePV.RPC("netDie", PhotonTargets.All, new object[] { this.v.normalized * 1000f + Vectors.up * 50f, false, num, text, true }); } } }
public bool cmd(string[] args, FengGameManagerMKII gm) { HERO hero = null; int playerId = PhotonNetwork.player.ID; foreach (HERO h in Object.FindObjectsOfType <HERO>()) { if (h.photonView.ownerId == playerId) { hero = h; break; } } FieldInfo gravityField = hero.GetType().GetField("gravity", BindingFlags.Instance | BindingFlags.NonPublic); if (this.originalGravity < 0f) { this.originalGravity = (float)gravityField.GetValue(hero); } if (args[0].Equals("on", System.StringComparison.OrdinalIgnoreCase)) { gravityField.SetValue(hero, originalGravity); } else { gravityField.SetValue(hero, 0f); } return(true); }
public bool cmd(string[] args, FengGameManagerMKII gm) { HERO hero = null; foreach (HERO h in GameObject.FindObjectsOfType <HERO>()) { if (h.photonView.isMine) { hero = h; break; } } if (hero == null) { ModMain.instance.sendToPlayer("You\'re not alive."); } else { GameObject horse = PhotonNetwork.Instantiate("horse", hero.gameObject.transform.position, Quaternion.Euler(0F, 0F, 0F), 0); horse.GetComponent <Horse>().myHero = hero.gameObject; } return(true); }
public override bool Execute(string[] args) { if (args.Length <= 0) { logMessage = Lang["errArg"]; return(false); } HERO myHero = FengGameManagerMKII.Heroes.FirstOrDefault(x => x.IsLocal); if (myHero == null) { logMessage = "Spawn your HERO first!"; return(false); } switch (args[0].ToLower()) { case "help": logMessage += "Available options:\ngas, cross(2), meat(2), "; break; case "default": case "gas": myHero.GasBurstAnimation = "FX/boost_smoke"; break; case "cross": myHero.GasBurstAnimation = "redCross"; break; case "cross2": myHero.GasBurstAnimation = "redCross1"; break; case "meat": myHero.GasBurstAnimation = "hitMeat"; break; case "meat2": myHero.GasBurstAnimation = "hitMeat2"; break; // Will probably be annoying / abusive for weak PC user //case "splatter": // break; case "blood": myHero.GasBurstAnimation = "bloodExplore"; break; //abusive too //case "thunder": // myHero.GasBurstAnimation = "FX/Thunder"; // break; default: logMessage = Lang["errArg"]; return(false); } return(true); }
public GameObject setMainObject(GameObject obj, bool resetRotation = true, bool lockAngle = false) { float num; this.main_object = obj; if (obj == null) { this.head = null; num = 1f; this.heightMulti = 1f; this.distanceMulti = num; this.main_objectR = null; this.main_objectT = null; } else if (this.main_object.transform.Find("Amarture/Core/Controller_Body/hip/spine/chest/neck/head") != null) { this.main_objectR = this.main_object.rigidbody; this.main_objectT = this.main_object.transform; this.main_objectH = this.main_object.GetComponent <HERO>(); this.head = this.main_objectT.Find("Amarture/Core/Controller_Body/hip/spine/chest/neck/head"); this.distanceMulti = (this.head != null) ? (Vector3.Distance(this.head.transform.position, this.main_objectT.position) * 0.2f) : 1f; this.heightMulti = (this.head != null) ? (Vector3.Distance(this.head.transform.position, this.main_objectT.position) * 0.33f) : 1f; if (resetRotation) { this.baseT.rotation = Quaternion.Euler(0f, 0f, 0f); } } else if (this.main_object.transform.Find("Amarture/Controller_Body/hip/spine/chest/neck/head") != null) { this.head = this.main_object.transform.Find("Amarture/Controller_Body/hip/spine/chest/neck/head"); num = 0.64f; this.heightMulti = 0.64f; this.distanceMulti = num; if (resetRotation) { this.baseT.rotation = Quaternion.Euler(0f, 0f, 0f); } this.main_objectR = this.main_object.rigidbody; this.main_objectT = this.main_object.transform; this.main_objectH = this.main_object.GetComponent <HERO>(); } else { this.main_objectR = this.main_object.rigidbody; this.main_objectT = this.main_object.transform; this.main_objectH = null; this.head = null; num = 1f; this.heightMulti = 1f; this.distanceMulti = num; if (resetRotation) { this.baseT.rotation = Quaternion.Euler(0f, 0f, 0f); } } this.lockAngle = lockAngle; return(obj); }
private void OnDisable() { if (owner != null) { owner.myBomb = null; owner = null; } myExplosion = null; }
public void ChangeGasAnim(ChatCommandContext ctx) { if (ctx.Arguments.Length <= 0) { ctx.SendLocalMessage(Lang["errArg"]); return; } HERO myHero = FengGameManagerMKII.Heroes.FirstOrDefault(x => x.IsLocal); if (myHero == null) { ctx.SendLocalMessage("Spawn your HERO first!"); return; } switch (ctx.Arguments[0].ToLower()) { case "help": ctx.SendLocalMessage("Available options:\ngas, cross(2), meat(2), blood"); break; case "default": case "gas": myHero.GasBurstAnimation = "FX/boost_smoke"; break; case "cross": myHero.GasBurstAnimation = "redCross"; break; case "cross2": myHero.GasBurstAnimation = "redCross1"; break; case "meat": myHero.GasBurstAnimation = "hitMeat"; break; case "meat2": myHero.GasBurstAnimation = "hitMeat2"; break; // Will probably be annoying / abusive for weak PC user //case "splatter": // break; case "blood": myHero.GasBurstAnimation = "bloodExplore"; break; //abusive too //case "thunder": // myHero.GasBurstAnimation = "FX/Thunder"; // break; default: ctx.SendLocalMessage(Lang["errArg"]); return; } }
public void playerAssignHero(NetworkConnection playerConnection, HERO hero) { var playerInfo = m_playerInfos[playerConnection.connectionId];//.team = team;// = team; Debug.Log("playerAssignHero"); playerInfo.hero = hero; m_playerInfos[playerConnection.connectionId] = playerInfo; spawnPlayer(playerConnection); }
public ActionResult DeleteConfirmed(int id) { List <HERO_TRANSLATION> heroTrans = db.HERO_TRANSLATIONs.Where(h => h.heroId == id).ToList(); HERO hERO = db.HEROs.Find(id); db.HERO_TRANSLATIONs.RemoveRange(heroTrans); db.HEROs.Remove(hERO); db.SaveChanges(); return(RedirectToAction("Index")); }
public void OnTriggerExit(Collider collider) { HERO hero = collider.transform.root.gameObject.GetComponent <HERO>(); if (hero != null && hero.baseG.layer == 8 && hero.IsLocal && storedHero != null && hero == storedHero) { hero.myCannonRegion = null; hero.ClearPopup(); storedHero = null; } }
public static void CheckAntiRevive(HERO hero, int ID) { if (!PhotonNetwork.isMasterClient || !Config.Settings.AntiRevive) { return; } if (antiReviveList.Contains(ID)) { hero.photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, "[FF0000]Anti-Revive" }); } }
public static void InfectionOnSpawn(HERO hero) { if (InfectionMode.Enabled && PhotonNetwork.IsMasterClient && !FengGameManagerMKII.FGM.IsLosing && !FengGameManagerMKII.FGM.IsWinning && FengGameManagerMKII.FGM.Logic.RoundTime > 5f) { if (infection.ContainsKey(hero.BasePV.owner.ID)) { hero.markDie(); hero.BasePV.RPC("netDie2", PhotonTargets.All, new object[] { -1, "noswitchingfgt" }); } } }
public override void Execute(InRoomChat irc, string[] args) { if (RCSettings.TeamMode == 1) { if (args.Length > 0) { if (args[0].Equals("1") || args[0].Equals("cyan", StringComparison.OrdinalIgnoreCase)) { FengGameManagerMKII.Instance.photonView.RPC("setTeamRPC", PhotonNetwork.player, 1); irc.AddLine("You have joined team Cyan.".WithColor("00FFFF")); HERO hero = GameHelper.GetHero(PhotonNetwork.player); if (hero != null) { hero.MarkDead(); hero.photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, "Team Switch" }); } } else if (args[0].Equals("2") || args[0].Equals("magenta", StringComparison.OrdinalIgnoreCase)) { FengGameManagerMKII.Instance.photonView.RPC("setTeamRPC", PhotonNetwork.player, 2); irc.AddLine("You have joined team Magenta.".WithColor("FF00FF")); HERO hero = GameHelper.GetHero(PhotonNetwork.player); if (hero != null) { hero.MarkDead(); hero.photonView.RPC("netDie2", PhotonTargets.All, -1, "Team Switch"); } } else if (args[0].Equals("0") || args[0].Equals("individual", StringComparison.OrdinalIgnoreCase)) { FengGameManagerMKII.Instance.photonView.RPC("setTeamRPC", PhotonNetwork.player, 0); irc.AddLine("You have joined team Individual.".WithColor("FFFFFF")); HERO hero = GameHelper.GetHero(PhotonNetwork.player); if (hero != null) { hero.MarkDead(); hero.photonView.RPC("netDie2", PhotonTargets.All, -1, "Team Switch"); } } else { irc.AddLine("Invalid team. Accepted values are 0, 1, and 2.".WithColor("FFCC00")); } } } else { irc.AddLine("Teams are either locked or disabled.".WithColor("FFCC00")); } }
// HERO.netPlayAnimation public static bool IsAnimationPlayValid(HERO hero, PhotonMessageInfo info) { if (info != null && hero.photonView.ownerId != info.sender.Id && !(info.sender.isMasterClient || GameHelper.IsPT(info.sender))) { Mod.Logger.Error($"'HERO.netPlayAnimation' from #{(info == null ? "?" : info.sender.Id.ToString())}"); if (info.sender != null && !FengGameManagerMKII.IgnoreList.Contains(info.sender.Id)) { FengGameManagerMKII.IgnoreList.Add(info.sender.Id); } return(false); } return(true); }
public static bool AntiReviveCheck(int ID, HERO hero) { if (AntiReviveEnabled()) { if (AntiReviveList.Contains(ID)) { hero.BasePV.RPC("netDie2", PhotonTargets.All, new object[] { -1, "Anti-Revive " }); return(true); } return(false); } return(false); }
// HERO.loadskinRPC public static bool IsSkinLoadValid(HERO hero, PhotonMessageInfo info) { if (info == null || (hero.photonView.ownerId != info.sender.Id)) { Mod.Logger.Error($"'HERO.loadskinRPC' from #{(info == null ? "?" : info.sender.Id.ToString())}"); if (info.sender != null && !FengGameManagerMKII.IgnoreList.Contains(info.sender.Id)) { FengGameManagerMKII.IgnoreList.Add(info.sender.Id); } return(false); } return(true); }
void FocusedPlayer(PhotonPlayer player) { foreach (HERO hero in FengGameManagerMKII.instance.heroes) { if (player.ID == hero.id) { current_Hero = hero; IN_GAME_MAIN_CAMERA.instance.setMainObject(hero.gameObject, true, false); IN_GAME_MAIN_CAMERA.instance.setSpectorMode(false); return; } } }