// Use this for initialization void Start() { NetworkAnimator netAnimator = GetComponent <NetworkAnimator>(); for (int i = 0; i < netAnimator.animator.parameterCount; i++) { netAnimator.SetParameterAutoSend(i, true); } ramArea = transform.GetChild(2).gameObject; if (!this.isLocalPlayer) { return; } // Set custom attributes for class: PlayerEffects pe = GetComponent <PlayerEffects>(); pe.CmdSetAttributes(1.5f, 1.0f, 1.0f, 0.8f); // Add abilities to class: PlayerAbilityManager abilityManager = GetComponent <PlayerAbilityManager>(); SpeedBomb sp = gameObject.AddComponent <SpeedBomb>(); Stomp stomp = gameObject.AddComponent <Stomp>(); stomp.init(); sp.init(30, 4); abilityManager.abilities.Add(sp); abilityManager.abilities.Add(stomp); GameObject.Find("AbilityPanel").GetComponent <AbilityPanel>().setupPanel(abilityManager); this._playerController = GetComponent <PlayerController>(); }
public override bool PreAI(Projectile projectile) { var mproj = Info(projectile); if (!mproj.FirstTick) { mproj.FirstTick = true; // Get effect values if (projectile.owner != 255 && projectile.friendly && projectile.owner == Main.myPlayer) { mplr = Main.LocalPlayer.GetModPlayer <ModifierPlayer>(); mplreffects = Main.LocalPlayer.GetModPlayer <PlayerEffects>(); if (mplr.GetEffect <ShadowPartnerEffect>().isActive&& !mplreffects.initializeShadowProjectile) { mplreffects.initializeShadowProjectile = true; Main.LocalPlayer.GetModPlayer <PlayerEffects>().createShadowProjectile(projectile); } else { mplreffects.initializeShadowProjectile = false; } } } return(base.PreAI(projectile)); }
public void PlayerEffect(PlayerEffects effects, EPlayer player) { switch (effects) { case PlayerEffects.Scp207: player.EnableEffect <Scp207>(Singleton.Config.Speed); player.ReferenceHub.playerEffectsController.ChangeEffectIntensity <Scp207>(Singleton.Config.AmountOfCokes); break; case PlayerEffects.Scp268: player.EnableEffect <Scp268>(15f); break; case PlayerEffects.Blinded: player.EnableEffect <Blinded>(Singleton.Config.BlindTime); break; case PlayerEffects.Sinkhole: player.EnableEffect <SinkHole>(Singleton.Config.SinkholeTime); break; default: break; } }
// Use this for initialization void Start() { this._animator = GetComponent<Animator>(); NetworkAnimator netAnimator = GetComponent<NetworkAnimator>(); for (int i = 0; i < netAnimator.animator.parameterCount; i++) netAnimator.SetParameterAutoSend(i, true); if (!this.isLocalPlayer) return; this._pc = GetComponent<PlayerController>(); // Set custom attributes for class: PlayerEffects pe = GetComponent<PlayerEffects>(); pe.CmdSetAttributes(0.7f, 0.8f, 1.2f, 1.0f); // Add abilities to class: this._am = GetComponent<PlayerAbilityManager>(); var ds = gameObject.AddComponent<DustStorm>(); var dt = gameObject.AddComponent<DustTornadoAbility>(); ds.init(); dt.init(); this._am.abilities.Add(ds); this._am.abilities.Add(dt); GameObject.Find("AbilityPanel").GetComponent<AbilityPanel>().setupPanel(this._am); this._pecking = false; }
// Use this for initialization void Start() { /* every component that is a PlayerComponent must be initialized with the base player */ myInput = (PlayerInput)GetComponent <PlayerInput>().initialize(this); myMovement = (PlayerMovement)GetComponent <PlayerMovement>().initialize(this); myStats = (PlayerStats)GetComponent <PlayerStats>().initialize(this); myNetworking = (PlayerNetworking)GetComponent <PlayerNetworking>().initialize(this); myGUI = (PlayerGUI)GetComponent <PlayerGUI>().initialize(this); myEffects = (PlayerEffects)GetComponent <PlayerEffects>().initialize(this); PlayerAbility[] abilityCandidates = GetComponents <PlayerAbility>(); myAbilities = new PlayerAbility[abilityCandidates.Length]; int myAbilityIndex = 0; foreach (PlayerAbility playerAbility in abilityCandidates) { myAbilities[myAbilityIndex] = (PlayerAbility)playerAbility.initialize(this); myAbilityIndex++; } myAnimator = transform.GetChild(0).GetComponent <Animator>(); myRigid = GetComponent <Rigidbody>(); myCollider = GetComponent <Collider>(); myNoFrictionCollider = transform.Find("NoFrictionSides").GetComponent <Collider>(); myNetworkIdentity = this.GetComponent <NetworkIdentity>(); if (isServer) { playerId = Guid.NewGuid().ToString(); } }
private void Start() { player = GetComponent <PlayerEffects>(); stats = this; ResetToDefault(); }
private void Start() { //viz = GetComponent<SightlineVisualizer>(); //these should be on the same object, right? pEffects = pHealth.gameObject.GetComponent <PlayerEffects>(); viz.CurrentColor = new Color(252f / 255f, 215f / 255f, 3f / 255f); StartCoroutine(Shoot()); childNav.speed = 0; //stop the childnav from actually travelling anywhere, just need to compute pathways with it }
void Start() { pc = GetComponent <CharacterController>(); pe = GetComponent <PlayerEffects>(); gravity = -(2 * maxJumpHeight) / Mathf.Pow(timeToJumpApex, 2); maxJumpVelocity = Mathf.Abs(gravity * timeToJumpApex); minJumpVelocity = Mathf.Sqrt(2 * Mathf.Abs(gravity) * minJumpHeight); }
private void Start() { nav = GetComponent <NavMeshAgent>(); pEffects = player.GetComponent <PlayerEffects>(); pHealth = player.GetComponent <PlayerHealth>(); aud = GetComponent <ObjectAudio>(); viz.CurrentColor = new Color(140f / 255f, 0, 241f / 255f); }
// Use this for initialization void Start() { t = GameObject.Find("toughnessBar").GetComponent <RectTransform>(); d = GameObject.Find("damageBar").GetComponent <RectTransform>(); s = GameObject.Find("speedBar").GetComponent <RectTransform>(); j = GameObject.Find("jumpBar").GetComponent <RectTransform>(); player = null; }
void tryGetPlayer() //Due to networking, this is needed because this gameobject will spawn before the player { GameObject obj = GameObject.FindGameObjectWithTag("Player"); if (obj != null) { player = obj.GetComponent <PlayerEffects>(); } }
protected override void Parse(EndianBinaryReader r) { EID = ReadVarInt(r); Effect = (PlayerEffects)r.ReadSByte(); #if DEBUGPACKET if (Effect.ToString() == ((int)Effect).ToString()) throw new NotImplementedException(Effect.ToString()); #endif }
private void Awake() { _playerHandling = GetComponent <PlayerHandling>(); _playerCheckpointResetter = GetComponent <PlayerCheckpointResetter>(); _ragdollController = GetComponent <RagdollController>(); _playerEffects = GetComponentInChildren <PlayerEffects>(); _health = _initialHealth; }
void Start() { pEffects = GetComponent <PlayerEffects>(); safe = false; dead = false; currentHealth = maxHealth; feet = GetComponent <FootstepAudio>(); feet.UnmuteFeet(); }
// Start is called before the first frame update void Start() { health = 100; GS = FindObjectOfType <GameSystem>(); body = GetComponent <Rigidbody2D>(); PM = GetComponent <PlayerMoving>(); PE = GetComponent <PlayerEffects>(); bar = FindObjectOfType <HPBar>(); bar.updateHealth(health); }
private void HitMago(PlayerEffects player) { if (full) { int ChosenPotionEffect = Random.Range(0, System.Enum.GetValues(typeof(PotionEffect)).Length);//, potionVariants.Length); potionType = (PotionEffect)ChosenPotionEffect; player.AddEffect(potionType, 3); GameController.Instance.AddPoints(25, playerIndex); } }
public bool isBurning() { PlayerEffects effect = getEffect("burning"); if (effect.getName() != "null" && effect.isActive()) { return(true); } return(false); }
protected override void Parse(EndianBinaryReader r) { EID = ReadVarInt(r); Effect = (PlayerEffects)r.ReadSByte(); #if DEBUG if (Effect.ToString() == ((int)Effect).ToString()) { throw new NotImplementedException(Effect.ToString()); } #endif }
void Start() { slotOneLabel = GeneralVariables.uiController.grenadeOneLabel; slotTwoLabel = GeneralVariables.uiController.grenadeTwoLabel; AntiHackSystem.ProtectInt("t1Grenade", typeOneGrenades); AntiHackSystem.ProtectInt("t1GrenadeMax", typeOneMaxGrenades); AntiHackSystem.ProtectInt("t2Grenade", typeTwoGrenades); AntiHackSystem.ProtectInt("t2GrenadeMax", typeTwoMaxGrenades); pe = GeneralVariables.player.GetComponent <PlayerEffects>(); }
/// <param name="effect"></param> /// <param name="amplifier">sbyte</param> /// <param name="duration">in seconds, more than 20 minutes might not work</param> public EntityEffect(int eid, PlayerEffects effect, int amplifier, int duration) { if ((int)effect < 1) effect = PlayerEffects.MoveSpeed; if ((int)effect > 20) effect = PlayerEffects.Wither; this.EID = eid; this.Effect = effect; this.Amplifier = (sbyte)amplifier; this.Duration = (short)(duration * 20); }
public void MultiPlayerFind() { hands = GameObject.Find("Hands").GetComponent <Hands>(); playStat = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerStats>(); database = GameObject.FindGameObjectWithTag("Item Database").GetComponent <ItemDatabase>(); vehicle = GameObject.Find("dirtbike").GetComponent <Vehicle>(); guns = GameObject.FindGameObjectWithTag("Projectile").GetComponent <Projectile>(); playEffect = GameObject.Find("PlayerEffects").GetComponent <PlayerEffects>(); itemPick = GameObject.FindGameObjectWithTag("Item").GetComponent <ItemPickup>(); headGear = GameObject.FindGameObjectWithTag("headGear").GetComponent <HeadGear>(); }
public PlayerEffectsRobot() { dashWind = new GameObject("dash-wind"); dashEffectSpawn = dashWind.transform; objects = Substitute.For <IObjects>(); playerEffects = new PlayerEffects( dashWind, dashEffectSpawn, objects ); }
private void StartPlayer() { equippedMask = Instantiate(eyes, transform, true); equippedMask.transform.localPosition = new Vector3(equippedMask.weaponAim.eyeDistance, 0, 0); _playerEffects = Instantiate(baseEffects); _playerAmmo = Instantiate(baseAmmoPool); equippedMask.playerEffects = _playerEffects; equippedMask.ammo = _playerAmmo; movement.playerEffects = _playerEffects; _playerHealth.playerEffects = _playerEffects; }
private void BuffDuration_OnPreUpdate(ModifierPlayer player) { int index; PlayerEffects mplrEffects = player.player.GetModPlayer <PlayerEffects>(); while (mplrEffects.buffExtender.Count > 0 && percentBuffDuration > 0f) { index = mplrEffects.buffExtender.First.Value; player.player.buffTime[index] = (int)Math.Ceiling(player.player.buffTime[index] + (player.player.buffTime[index] * percentBuffDuration)); mplrEffects.buffExtender.RemoveFirst(); } }
public void Set() { Debug.Log("setting level settings"); playerXform = GameObject.FindGameObjectWithTag("Player").transform; playerCameraXform = GameObject.FindGameObjectWithTag("MainCamera").transform; playerFX = playerXform.GetComponent<PlayerEffects>(); playerFX.SetFootsteps(footstepEffectCollection); playerFX.SetTemperature(levelAmbientTemperature); playerXform.position = spawnLocations[(int)activeSpawn].position; playerXform.rotation = spawnLocations[(int)activeSpawn].rotation; playerXform.localScale = spawnLocations[(int)activeSpawn].localScale; }
void Start() { if (SceneManager.GetActiveScene().name == "Lobby") { return; } NetworkAnimator netAnimator = GetComponent <NetworkAnimator>(); for (int i = 0; i < netAnimator.animator.parameterCount; i++) { netAnimator.SetParameterAutoSend(i, true); } this._poopCameraPos = transform.GetChild(2); bunnyPoop = Resources.Load <GameObject>("Prefabs/poop"); playerInfo = GetComponent <PlayerInformation>(); if (!this.isLocalPlayer) { return; } _controller = GetComponent <CharacterController>(); _timer = 0; _fireRate = 0.2f; // Set custom attributes for class: PlayerEffects pe = GetComponent <PlayerEffects>(); pe.CmdSetAttributes(1.0f, 1.0f, 1.0f, 1.5f); // Add abilities to class: PlayerAbilityManager abilityManager = GetComponent <PlayerAbilityManager>(); SuperJump sj = gameObject.AddComponent <SuperJump>(); sj.init(10); GrenadePoop gp = gameObject.AddComponent <GrenadePoop>(); gp.init(); abilityManager.abilities.Add(sj); abilityManager.abilities.Add(gp); GameObject.Find("AbilityPanel").GetComponent <AbilityPanel>().setupPanel(abilityManager); this._alertOverlay = GameObject.Find("Alert").GetComponent <Image>(); this._alertSound = Resources.Load <AudioClip>("Audio/BunnyAlert"); CmdGetEnemies(); this._playerController = GetComponent <PlayerController>(); this._alertReady = false; StartCoroutine(alertCooldown(2.0f)); }
private void DebuffResist_OnPreUpdate(ModifierPlayer player) { PlayerEffects mplrEffects = player.player.GetModPlayer <PlayerEffects>(); while (mplrEffects.buffResistor.Count > 0 && percentResist > 0f) { if (AttemptResist()) { player.player.DelBuff(mplrEffects.buffResistor.First.Value); } mplrEffects.buffResistor.RemoveFirst(); } }
public void SetReferenceVars() { PlayerReference pRef = GeneralVariables.playerRef; if (pRef != null) { pe = pRef.GetComponent <PlayerEffects>(); wm = pRef.wm; dm = pRef.dm; pm = pRef.GetComponent <PlayerMovement>(); ac = pRef.ac; acs = pRef.acs; } }
void Awake() { canvasGroup = GameObject.Find("BlackoutImage").GetComponent <CanvasGroup>(); //textObject = GameObject.Find("BlackoutText"); if (Instance == null) { Instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
private void OnTriggerEnter(Collider other) { PlayerEffects pe = other.gameObject.GetComponent <PlayerEffects>(); if (other.gameObject.CompareTag("Player")) { this.HitMago(pe); } if (other.gameObject.CompareTag("Wall")) { StartCoroutine(DisableCollider(other, 5)); } }
private void OnTriggerEnter(Collider other) { Debug.Log("Trigger"); if (thrown && other.CompareTag("Player")) { //J: atualiza contador de poções, para criar nova poção Destroy(gameObject); PlayerEffects pe = other.GetComponent <PlayerEffects>(); Debug.Assert(pe != null); this.HitPlayer(pe); GameController.potionCount--; } }
/// <param name="effect"></param> /// <param name="amplifier">sbyte</param> /// <param name="duration">in seconds, more than 20 minutes might not work</param> public EntityEffect(int eid, PlayerEffects effect, int amplifier, int duration) { if ((int)effect < 1) { effect = PlayerEffects.MoveSpeed; } if ((int)effect > 20) { effect = PlayerEffects.Wither; } this.EID = eid; this.Effect = effect; this.Amplifier = (sbyte)amplifier; this.Duration = (short)(duration * 20); }
private void RpcApplyDamage(AttackMessage message) { PlayerEffects playerEffects = this.gameObject.GetComponent <PlayerEffects>(); if ((playerEffects != null) && !this._isDead && !this._damageImmune) { this.updateDamageScreen(message.damageAmount); playerEffects.CmdBloodParticle(message.impactPosition); if (this._isDead) { this.die(message.attackerID); } } }
void Awake() { player = transform.parent.gameObject; effectsController = transform.parent.GetComponent<PlayerEffects>(); networkManager = GameObject.FindGameObjectWithTag( Tags.NetworkController ).GetComponent<NetworkManager>(); burstFireCoolDown = 0.5f; burstFireAmount = 3.0f; burstFireToggleRate = 0.5f; swapRate = 1.0f; reloadRate = 2.5f; coolDown = 0.1f; maxAmmo = 32.0f; maxSpare = 200.0f; range = 10000.0f; damage = 10.0f; bulletSpread = 0.01f; bulletCircleRadius = 1.0f; WeaponAwake(); }
void Awake() { player = transform.parent.gameObject; effectsController = transform.parent.GetComponent<PlayerEffects>(); networkManager = GameObject.FindGameObjectWithTag( Tags.NetworkController ).GetComponent<NetworkManager>(); swapRate = 1.0f; reloadRate = 4.0f; coolDown = 1.0f; maxAmmo = 1.0f; maxSpare = 4.0f; range = 100000.0f; damage = 75.0f; bulletSpread = 0.01f; bulletCircleRadius = 0.5f; regCamView = 60.0f; zoomMultiplier = 0.14285f; WeaponAwake(); shotFired = false; }
//updates the debug based on player void updateDebug(TextMesh tm, PlayerController pscript) { string effectsText = " "; PlayerEffects pe = new PlayerEffects("null"); if(pscript.isBreezing()){ pe = pscript.getEffect("breezing"); effectsText = effectsText + pe.getName() + " " + pe.getTimer() + "/" + pe.getTimerMax(); } //add all the text to text mesh tm.text = "\nhp: "+ pscript.getCurrHealth() + "/" + pscript.getMaxHealth()+ "\naction: "+ pscript.getAction() + "\neffects: "+ effectsText + "\npassive: "+ pscript.getSkillPassive().getName()+ " "+ pscript.getSkillPassive().displayCooldown()+ "\ng: "+pscript.getSkillA().getName()+ " "+ pscript.getSkillA().displayCooldown()+ "\nh: "+pscript.getSkillB().getName()+ " "+ pscript.getSkillB().displayCooldown()+ "\nj: "+pscript.getSkillC().getName()+ " "+ pscript.getSkillC().displayCooldown()+ "\n "; }
protected void Start() { effectsController = GetComponent<PlayerEffects>(); currBoosts = maxBoosts; currBoostTime = boostDuration; }
// Use this for initialization void Start() { //cover not engaged by default coverEngaged = false; effectsController = GetComponent<PlayerEffects>(); }
public RemoveEntityEffect(int eid, PlayerEffects effect) { this.EID = eid; this.Effect = effect; }
void SetInitialReferences() { if (GameObject.Find("_GameManager").GetComponent<GameManager_Master>() != null) { gameManagerMaster = GameObject.Find("_GameManager").GetComponent<GameManager_Master>(); } if (GetComponent<PlayerEffects>() != null) { effects = GetComponent<PlayerEffects>(); } if (GetComponent<Player_Master>() != null) { playerMaster = GetComponent<Player_Master>(); } playerRigidBody = GetComponent<Rigidbody>(); playerCapsule = GetComponent<CapsuleCollider>(); playerAnimator = GetComponent<Animator>(); playerAudio = GetComponent<PlayerAudio>(); }
public EffectPost(PlayerEffects eff) { this.Effect = eff; }
void OnEnable() { rb = GetComponent<Rigidbody>(); effects = GetComponent<PlayerEffects>(); }