public override void Do(GameObject player) { PlayerEffectsManager manager = player.GetComponent <PlayerEffectsManager>(); manager.ShakePlayer(shakeDuration, shakeIntensity, shakeDelay); base.Do(player); }
private void Awake() { playerAttacker = GetComponent <PlayerAttacker>(); playerInventory = GetComponent <PlayerInventory>(); playerManager = GetComponent <PlayerManager>(); tutorial = FindObjectOfType <tutorialHandler>(); playerEffectsManager = GetComponentInChildren <PlayerEffectsManager>(); playerAnimatorManager = GetComponentInChildren <AnimatorHandler>(); weaponSlotManager = GetComponentInChildren <WeaponSlotManager>(); playerLocomotion = GetComponent <PlayerLocomotion>(); playerStats = GetComponent <PlayerStats>(); cameraHolder = FindObjectOfType <CameraHolder>(); UIManager = FindObjectOfType <UIManager>(); help_input = false; }
public GameState(Game1 gameReference) : base(gameReference) { mapBatch = new SpriteBatch(graphicsDevice); CreateMapReader(); CreateMapBuilder(); BuildMap(); SpawnPlayer(); camera = new Camera(game, inputManager, player); CreatePhysicsManager(); playerEffectsManager = new PlayerEffectsManager(this, graphicsDevice, font, player, textures["Timer"]); SpawnAllEnemies(); LoadThemeSong(); game.PlaySong(levelThemeSong); AddEndLevelFlag(); CreateGameOverComponents(); }
public override void ServerAttackMethod(Vector3 aimingVector) { RaycastHit2D hit = Physics2D.Raycast(transform.position, aimingVector, range); // Hit logic if (hit.transform != null) { // How to damage players from the server but using effects on contact: // 1. Search for a PlayerEffectsManager: PlayerEffectsManager playerEffectsManager = hit.transform.GetComponent <PlayerEffectsManager>(); // 2. If one exists, just damage it. Simple! if (playerEffectsManager != null) { playerEffectsManager.RpcAddEffect(new PlayerEffect(/*EffectType.HealthPerSecond*/ 1, 2.0f, 0.5f, "")); //I think I fixed this with Jake at MV code club } } }
public virtual void AttemptToConsumeItem(AnimatorHandler playerAnimatorManager, WeaponSlotManager weaponSlotManager, PlayerEffectsManager playerEffectsManager) { if (currentItemAmount > 0 && maxItemAmount >= currentItemAmount) //si tiene items que consumir { //hacer animacion playerAnimatorManager.PlayTargetAnimation(consumeAnimation, isInteracting); currentItemAmount = currentItemAmount - 1; } else { //hacer animacion de que no tiene mas consumibles , deteniendo al player un instante //playerAnimatorManager.PlayTargetAnimation("Shrug", true); } }
public override void AttemptToConsumeItem(AnimatorHandler playerAnimatorManager, WeaponSlotManager weaponSlotManager, PlayerEffectsManager playerEffectsManager) { base.AttemptToConsumeItem(playerAnimatorManager, weaponSlotManager, playerEffectsManager); GameObject flask = Instantiate(itemModel, weaponSlotManager.leftHandSlot.transform); //instanciamos el modelo del item en la mano derecha playerEffectsManager.currentParticleFX = recoveryFX; //le pasamos el fx playerEffectsManager.amountToBeHealed = healthRecoverAmount; //le pasamos la vida que le tiene que sumar playerEffectsManager.instantiatedFXModel = flask; weaponSlotManager.leftHandSlot.UnloadWeapon(); //ocultamos arma en la mano para poner el item consumible }