Наследование: MonoBehaviour
Пример #1
0
        public IndicatorManager(PlayerManager playerManager, ContentManager content)
        {
            foreach (Player player in playerManager.Players)
            {
                nameDrawers.AddFirst(new NameDrawer(player, content));
                Texture2D barTexture = content.Load<Texture2D>("Scene/Game/stockbar1p");
                Texture2D stockTexture = content.Load<Texture2D>("Scene/Game/stock1p");
                if (stockDrawers.Count == 0)
                {
                    barTexture = content.Load<Texture2D>("Scene/Game/stockbar1p");
                    stockTexture = content.Load<Texture2D>("Scene/Game/stock1p");
                }
                if (stockDrawers.Count == 1)
                {
                    barTexture = content.Load<Texture2D>("Scene/Game/stockbar2p");
                    stockTexture = content.Load<Texture2D>("Scene/Game/stock2p");
                }
                if (stockDrawers.Count == 2)
                {
                    barTexture = content.Load<Texture2D>("Scene/Game/stockbar3p");
                    stockTexture = content.Load<Texture2D>("Scene/Game/stock3p");
                }
                if (stockDrawers.Count == 3)
                {
                    barTexture = content.Load<Texture2D>("Scene/Game/stockbar4p");
                    stockTexture = content.Load<Texture2D>("Scene/Game/stock4p");
                }

                stockDrawers.AddFirst(new StockDrawer(player, stockDrawers.Count, barTexture, stockTexture));
            }
            timer = new Timer(content);
        }
Пример #2
0
    public Animator anim;                                  // The animator component from the player.

    public void Start()
    {
        playerManager = GetComponent<PlayerManager>();
        playerController = GetComponent<PlayerController>();
        playerAttack = GetComponent<PlayerAttack>();
        anim = GetComponent<Animator>();
    }
Пример #3
0
 void Start()
 {
     manager = GameObject.Find("PlayerManager").GetComponent<PlayerManager>();
     shooter = gameObject.GetComponent<myShooter>();
     shooter.SetShooitngInfo(shooting_way, shooting_amount, shooting_repeat, shooting_period, shooting_delay, shooting_angle);
     SetBullet();
 }
    private float m_timer; //(秒)

    #endregion Fields

    #region Methods

    //初期化===================================================================
    void Awake()
    {
        base.m_doNotPause = true;

        //PlayerManager取得----------------------------------------------------
        m_PlyMgr = GameObject.FindObjectOfType<PlayerManager>();
    }
Пример #5
0
 // Use this for initialization
 void Start()
 {
     cm = GameObject.Find ("Configuration").GetComponent <ConfigManager>();// GetComponent<ConfigManager> ();
     pm = GameObject.Find("Player").GetComponent<PlayerManager>();
     pufferSlider.maxValue = (float)Double.Parse(cm.Load ("MaxPufferCharge"));;
     breathSlider.maxValue = (float)Double.Parse(cm.Load ("MaxBreath"));
 }
Пример #6
0
 /// <summary>
 /// Sets all necessary references.
 /// </summary>
 /// <param name="shooter"></param>
 public void Setup(ShooterManager shooter)
 {
     //networkLayer = this.GetComponent<BulletNetworkLayer>();
     this.shooter = shooter;
     playerManager = shooter.GetComponent<PlayerManager>();
     //this.collider.enabled = shooter.GetComponent<PhotonView>().isMine;
 }
Пример #7
0
    void Awake()
    {
        manager = this;

        playerManager = GetComponent<PlayerManager>();
        collectibleManager = GetComponent<CollectibleManager> ();
    }
Пример #8
0
 public RoundScoreManager(Dictionary<int, Player> pd)
 {
     pirateScore = 0;
     superCorpScore = 0;
     pm = PlayerManager.singleton;
     playerDict = pd; //Reference to other dictionary, means changes here change there too
 }
Пример #9
0
    // Use this for initialization
    void Awake()
    {
        Debug.Assert(SaveGameEventSubscription == null && AutoSaveGameEventSubscription == null);
        SaveGameEventSubscription= MessageHub.Subscribe<SaveGameEvent>(SaveGame);
        AutoSaveGameEventSubscription = MessageHub.Subscribe<AutoSaveGameEvent>(AutoSaveGame);

        mapData = new CollectedMapData();

        space = GameObject.Find("Space").GetComponent<Space>();
        if (space == null)
        {
            throw new MissingComponentException("Unable to find Space. The big bang doesn't have enough space to happen. The 'Space' game object also needs to be added to the level and have the space script attached.");
        }

        airTrafficControl = GameObject.Find("AirTrafficControl").GetComponent<AirTrafficControl>();
        if (space == null)
        {
            throw new MissingComponentException("Unable to find AirTrafficControl. There can't be any troops flying around without an global AirTrafficControl GameObject that has an AirTrafficControl Script attached.");
        }

        gameState = GameObject.Find("2D_MainCam").GetComponent<GameState>();
        if (gameState == null)
        {
            throw new MissingComponentException("Unable to find GameState. The 'GameState' script needs to be attached to the same Gameobject as the BigBang.");
        }
        playerManager = GameObject.Find("PlayerManagement").GetComponent<PlayerManager>();
        if (playerManager == null)
        {
            throw new MissingComponentException("Unable to find playerManager.");
        }
    }
Пример #10
0
    void OnEnable()
    {
        my = gameObject.GetComponent <Transform>();
        playerManager = GameObject.FindGameObjectWithTag("Manager").GetComponentInChildren<PlayerManager>();

        arrowPath = "Weapon/Arrow/Arrow" + playerManager.a.ToString();
        starPath = "Weapon/Star/Star" + playerManager.a.ToString();

        arrowBullet = my.FindChild("Arrow");
        starBullet = my.FindChild("Star");

        arrowBullet.GetComponent<SpriteRenderer>().sprite =
            Resources.Load<Sprite>(arrowPath);
        starBullet.GetComponent<SpriteRenderer>().sprite =
            Resources.Load<Sprite>(starPath);

        starBullet.gameObject.SetActive(false);
        arrowBullet.gameObject.SetActive(false);

        if (playerManager.wState == WeaponState.arrow)
        {
            arrowBullet.gameObject.SetActive(true);
        }
        else if (playerManager.wState == WeaponState.star)
        {
            starBullet.gameObject.SetActive(true);
        }
    }
Пример #11
0
 void Start()
 {
     if (!player)
     {
         player = GameObject.Find("Player").GetComponent<PlayerManager>();
     }
 }
Пример #12
0
    // Called in Bridge.cs
    public void setUniverse(int num)
    {
        Debug.Log("Universe Sent " + num);
        universeNum = num;

        // Get the origin of the set Universe
        Vector3 origin = GameObject.Find("Universe" + num + "/Managers/OriginManager").GetComponent<Universe>().origin;
        Debug.Log(num + "Universe " + origin);

        // Set camPos to bgPos + 1000 to z
        Vector3 camPos = new Vector3(origin.x, origin.y, origin.z + 0.1f);
        Debug.Log("camera positons " + camPos);
        Camera = (Transform)Instantiate(camPrefab, camPos, new Quaternion(0, 0, 0, 0));
        Camera.name = "Camera " + num;

        // It is the first time this function has been called
        if (characterNum == 99)
        {
            characterNum = universeNum;
            Log.Note("Activate initial");
            playerMovement = GameObject.Find("Character" + num).GetComponent<PlayerMovement>();
            playerMovement.activateCharacter(num, num);
            playerManager = GameObject.Find("Character" + num).GetComponent<PlayerManager>();
            playerManager.activateCharacter(num);
            FiringHandler fireHandler = GameObject.Find("Character" + num).GetComponent<FiringHandler>();
            fireHandler.activateCharacter(num);
        }

        playerManager.universeNumber = num;
    }
Пример #13
0
	// Use this for initialization
	void Awake () {
		Player = GameObject.Find ("Player");
		PlayerInventory = Player.transform.FindChild ("Inventory").GetComponent<Inventory> ();
		CharacterContener = Player.transform.FindChild ("Equipement").gameObject;
		PlayerHealth = Player.GetComponent<PlayerManager> ();

	}
Пример #14
0
    // called when object instantiated
    void Awake() {
        layerMask = ~(1 << LayerMask.NameToLayer("Player"));
        camera = Camera.main.transform;

        aim = GetComponent<PlayerAimBehaviour>();
        manager = GetComponent<PlayerManager>();
    }
 void Awake()
 {
     canvas = GetComponent<Canvas> ();
     listView = GetComponentInChildren<ListView> ();
     roomTimeManager = GameObject.FindGameObjectWithTag ("RoomTimeManager").GetComponent<RoomTimeManager> ();
     playerManager = GameObject.FindGameObjectWithTag ("PlayerManager").GetComponent<PlayerManager> ();
 }
Пример #16
0
 void Start()
 {
     m_bmgr = BattleManager.Get();
     m_pmgr = PlayerManager.Get();
     GameObject obj = GameObject.Find("MapCam");
     m_camera = obj.GetComponent<Camera>();
 }
Пример #17
0
	public void TakeDamage(int amount, PlayerManager from) {
		if (!isServer || !m_IsAlive)
			return;

		if (m_CurrentShield > 0) {
			m_CurrentShield -= amount;
			amount = (m_CurrentShield > 0) ? 0 : Mathf.Abs (m_CurrentShield);
		}

		m_CurrentHealth -= amount;

		if(m_CurrentHealth <= 0){
			from.GetKills++;
			GameManager.s_Instance.RpcUpdateStatus ();
			m_CurrentHealth = m_BaseHealth;
			RpcSetPlayerctive (false);
			switch (GameManager.m_MatchMode) {
			case 0:
				StartCoroutine(SetRespawn());
				break;
			case 1: 
				break;
			}
			RpcExplode ();
		}
	}
 // Use this for initialization
 void Start()
 {
     _players = PlayerManager.getManager();
     GameManager game = GameManager.getManager();
     transform.parent = game.transform;
     game.AssignNetworkManager(this);
 }
Пример #19
0
	// Use this for initialization
	void Start () {
        CurrentLevel = 3;

        instance = this;
        _temple = FindObjectOfType<Temple>();

    }
Пример #20
0
    // Use this for initialization
    void Start()
    {
        playerManager = GameObject.Find("PlayerManager").GetComponent<PlayerManager>();

        activeController = playerManager.GetActivePlayer().GetComponent<PlayerController>();
        controllerName = activeController.GetControllerName();
    }
Пример #21
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.GetComponent<PlayerManager>())
        {
            if (!player)
            {
                player = other.GetComponent<PlayerManager>();
            }

            if(player.GetNumOfCarbons() >= carbonsNeeded)
            {

                if (nextLayer == 3)
                {
                    player.BecomeDiamond();
                }
                else
                {
                    player.GetComponent<HoldInPlace>().enabled = true;
                    player.GetComponent<FlyTo>().setTarget(transform.position);
                    player.GetComponent<FlyTo>().enabled = true;
                    GameManager.art.SwitchLayer(nextLayer);
                    GameManager.music.moveDownLayer();
                }
            }
        }
    }
Пример #22
0
 void Awake()
 {
     if (instance == null)
         instance = this;
     else if (instance != this)
         Destroy(gameObject);
 }
Пример #23
0
 public PlayerManager()
 {
     //DontDestroyOnLoad(this);
     singleton = this;
     playerDict = new Dictionary<int, Player>();
     connectionDict = new Dictionary<int, NetworkConnection>();
 }
    /// <summary>
    /// Gets all necessary references.
    /// </summary>
    public void Initialize()
    {
        photonView = this.GetComponent<PhotonView>();
        myPlayer = this.GetComponent<PlayerManager>();

        isMine = photonView.isMine;
    }
Пример #25
0
    void Start()
    {
        audio_source = GetComponent<AudioSource> ();

                if (new_level) {
                        SelectMusic ();
                        new_level = false;
                }

                levelManager = GameObject.Find ("LevelLogic").GetComponent<LevelManager> ();
                enemyManager = GameObject.Find ("LevelLogic").GetComponent<EnemyManager> ();
                playerManager = GameObject.Find ("LevelLogic").GetComponent<PlayerManager> ();

                //Form level
                levelManager.InitLevelMap ();
                //Update Each Tile in map - includeds asigning values through CA

                levelManager.UpdateGapsAndPlatforms ();
                levelManager.UpdateLevelMap ();
                //Draw level
                levelMap = levelManager.GetLevelMap ();
                levelManager.DrawLevelMap ();

                //Get level map tile array
                //levelMap = levelManager.GetLevelMap ();

                enemyManager.LoadMap (levelMap);
                playerManager.LoadMap (levelMap);

                //Player must be loaded after level for raycasting to work
                playerManager.LoadPlayerSpawn ();
                playerManager.LoadEndPoint ();
                enemyManager.LoadEnemySpawns ();
    }
Пример #26
0
 void Start()
 {
     currPlayer = 0;
     playerScores = new int[2];
     playerManagerScript = FindObjectOfType<PlayerManager>();
     HUDManagerScript    = FindObjectOfType<HUDManager>();
 }
Пример #27
0
 // Use this for initialization
 void Start()
 {
     castleCount = 0;
     isPlacing = false;
     playerManager = GetComponent<PlayerManager>();
     tileManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent<TileManager>();
 }
Пример #28
0
    // Use this for initialization
    void Start ()
    {
        playerManager = GetComponent<PlayerManager>();
        playerAttack = GetComponent<PlayerAttack>();
        playerAnimation = GetComponent<PlayerAnimation>();
        rigidBody = GetComponent<Rigidbody>();
        trans = GetComponent<Transform>();
	}
Пример #29
0
 public void Initialise(int index, PlayerManager manager)
 {
     playerIndex = index;
     if (index % 2 == 0) {
         controllerSide = true;
     }
     playerManager = manager;
 }
Пример #30
0
 public static void Initialize()
 {
     ClientDB = ClientDBManager.GetInstance();
     Redirect = RedirectManager.GetInstance();
     Session  = SessionManager.GetInstance();
     Player   = PlayerManager.GetInstance();
     Spawns   = SpawnManager.GetInstance();
 }
Пример #31
0
 public GameController(PlayerManager playerManager)
 {
     _playerManager = playerManager;
 }
Пример #32
0
 public ModuleAddedProcessor(PlayerManager playerManager)
 {
     this.playerManager = playerManager;
 }
Пример #33
0
 /// <summary>
 /// Activar la habilidad, que puede ser en combate o fuera de él.
 /// Requiere que se le envíe un objeto
 /// </summary>
 /// <param name="interactable"></param>
 public virtual void ImplementHability(PlayerManager player, InteractableObject interactable)
 {
     AddExperience();
 }
Пример #34
0
 public virtual void ImplementHability <T>(PlayerManager player, T thing, string[] separatedInputs)
 {
     AddExperience();
 }
Пример #35
0
 private void Awake()
 {
     m_board   = FindObjectOfType <Board.Board>();
     m_player  = FindObjectOfType <PlayerManager>();
     m_enemies = FindObjectsOfType <EnemyManager>().ToList();
 }
Пример #36
0
 /// <summary>
 /// Aumenta la infravisión y la supravisión en 3.
 /// </summary>
 /// <param name="player"></param>
 public override void ActivatePassiveHability(PlayerManager player)
 {
     player.characteristics.ChangeVision(3, 3);
 }
Пример #37
0
    // Called on awake. Generates the dungeon and sets the players in the first room
    private void generateDungeon()
    {
        if (proceduralGeneration)
        {
            // Don't even try to generate the dungeon if we have less than 2 rooms
            if (numRooms < 2)
            {
                Debug.Log("Error generating dungeon, too few numRooms specified");
                return;
            }
            // Figure out how many of each room we want for a balanced dungeon
            // (Half horde rooms, quarter puzzle rooms, quarter reaction rooms, favor puzzle rooms if odd number)
            if (roomBalance)
            {
                goalHordeRooms    = Mathf.CeilToInt((float)(numRooms - 2) / 2.0f);
                goalPuzzleRooms   = Mathf.CeilToInt((float)(numRooms - 2 - goalHordeRooms) / 2.0f);
                goalReactionRooms = numRooms - 2 - goalHordeRooms - goalPuzzleRooms;
            }

            // Get references to all of the room prefab files
            dir  = new DirectoryInfo(RoomPrefabFilePath);
            info = dir.GetFiles("*.prefab");

            // Generate the dungeon with a recursive function that works one room at a time
            List <RoomPrefab>        roomsToUse   = new List <RoomPrefab>();
            Dictionary <string, int> numRoomTypes = new Dictionary <string, int>()
            {
                { "_H_", 0 }, { "_P_", 0 }, { "_R_", 0 }, { "_T_", 0 }, { "_S_", 0 }, { "_B_", 0 }
            };
            generateRoom(roomsToUse, numRoomTypes);

            // Log an error message if the generation failed
            if (roomsToUse.Count == 0)
            {
                Debug.Log("Error generating dungeon, could not generate dungeon from given room prefabs");
                return;
            }

            // Once the main path through the dungeon has been generated, replace a few of the rooms with rooms that can branch
            List <RoomPrefab> sideRooms = setupSidePaths(roomsToUse);

            // Once all of the rooms have been selected, set up the map and connect the rooms
            foreach (RoomPrefab rp in roomsToUse)
            {
                string rName = rp.prefabName.Substring(0, rp.prefabName.Length - 7);
                map.addRoom(rName);
            }
            for (int i = 0; i < map.rooms.Count - 1; i++)
            {
                map.connectRooms(map.rooms[i], map.rooms[i + 1], roomsToUse[i].exit);
            }
            // Load the first room and its neighbors
            loadRoom(map.rooms[0]);
            //loadNeighbors(map.rooms[0]);
            for (int i = 0; i < map.rooms.Count; i++)
            {
                loadNeighbors(map.rooms[i]);
            }
            // Give the player manager the first room's spawn points
            pMan = GameObject.Find("PlayerManager").GetComponent <PlayerManager>();
            pMan.assignNewSpawnPoints(map.rooms[0].playerRespawns.ToArray());
        }
        else
        {
            for (int i = 0; i < roomsToLoad.Length; i++)
            {
                map.addRoom(roomsToLoad[i]);
            }
            // Set up the first room of the dungeon
            loadRoom(map.rooms[0]);
            // hardcoded room neighbors, this must be done by hand to get rooms to connect for this method
            map.connectRooms(map.rooms[0], map.rooms[1], Direction.NORTH);
            map.connectRooms(map.rooms[1], map.rooms[2], Direction.NORTH);
            map.connectRooms(map.rooms[2], map.rooms[3], Direction.WEST);
            // Look at the first room's neighbors and set them up
            loadNeighbors(map.rooms[0]);
            // Give the player manager the first room's spawn points
            pMan = GameObject.Find("PlayerManager").GetComponent <PlayerManager>();
            pMan.assignNewSpawnPoints(map.rooms[0].playerRespawns.ToArray());
        }
    }
Пример #38
0
 void Awake()
 {
     instance = this;
 }
 public PlayerUseWarperProcessor()
 {
     playerManager = MultiplayerHostSession.Instance.PlayerManager;
 }
 private void Awake()
 {
     _instance = this;
 }
Пример #41
0
 /// <summary>
 /// Activar la habilidad, que puede ser en combate o fuera de él.
 /// Requiere que se le envíe el manager del jugador.
 /// </summary>
 /// <param name="player"></param>
 public virtual void ImplementHability(PlayerManager player, PlayerInstance npc)
 {
     AddExperience();
 }
Пример #42
0
 void Start()
 {
     pm = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerManager>();
 }
Пример #43
0
    public void Init(GameManager gameManager, GameData gameData, ActionsManager actionsManager, PlayerManager playerManager, ChatManager chatManager)
    {
        _gameManager              = gameManager;
        _actionsManager           = actionsManager;
        _playerManager            = playerManager;
        _chatManager              = chatManager;
        _gameData                 = gameData;
        _gameManager.OnTickTimer += HandleTick;

        StreamingEvents = new List <EventData>();
        StreamingEvents.AddRange(_gameData.StreamingEvents);

        OutsideEvents = new List <EventData>();
        OutsideEvents.AddRange(_gameData.OutsideEvents);

        CommentsEvents = new List <EventData>();
        CommentsEvents.AddRange(_gameData.CommentsEvent);

        _gameData.NextEventAtTicks = Random.Range(60, 80);
    }
Пример #44
0
 public DysonSphereAddLayerProcessor()
 {
     playerManager = MultiplayerHostSession.Instance.PlayerManager;
 }
Пример #45
0
        public void BuildProfile(WorldObject wo, Player examiner, bool success = true)
        {
            //Console.WriteLine("Appraise: " + wo.Guid);
            Success = success;

            // get wielder, if applicable
            var wielder = GetWielder(wo, examiner);

            BuildProperties(wo, wielder);
            BuildSpells(wo);

            // Help us make sure the item identify properly
            NPCLooksLikeObject = wo.GetProperty(PropertyBool.NpcLooksLikeObject) ?? false;

            if (PropertiesIID.ContainsKey(PropertyInstanceId.AllowedWielder))
            {
                if (!PropertiesBool.ContainsKey(PropertyBool.AppraisalHasAllowedWielder))
                {
                    PropertiesBool.Add(PropertyBool.AppraisalHasAllowedWielder, true);
                }
            }

            if (PropertiesIID.ContainsKey(PropertyInstanceId.AllowedActivator))
            {
                if (!PropertiesBool.ContainsKey(PropertyBool.AppraisalHasAllowedActivator))
                {
                    PropertiesBool.Add(PropertyBool.AppraisalHasAllowedActivator, true);
                }
            }

            if (PropertiesString.ContainsKey(PropertyString.ScribeAccount) && !examiner.IsAdmin && !examiner.IsSentinel && !examiner.IsArch && !examiner.IsPsr)
            {
                PropertiesString.Remove(PropertyString.ScribeAccount);
            }

            if (PropertiesString.ContainsKey(PropertyString.HouseOwnerAccount) && !examiner.IsAdmin && !examiner.IsSentinel && !examiner.IsArch && !examiner.IsPsr)
            {
                PropertiesString.Remove(PropertyString.HouseOwnerAccount);
            }

            if (PropertiesInt.ContainsKey(PropertyInt.Lifespan))
            {
                PropertiesInt[PropertyInt.RemainingLifespan] = wo.GetRemainingLifespan();
            }

            // armor / clothing / shield
            if (wo is Clothing || wo.IsShield)
            {
                BuildArmor(wo);
            }

            if (wo is Creature creature)
            {
                BuildCreature(creature);
            }

            if (wo is MeleeWeapon || wo is Missile || wo is MissileLauncher || wo is Ammunition || wo is Caster)
            {
                BuildWeapon(wo, wielder);
            }

            if (wo is Door || wo is Chest)
            {
                // If wo is not locked, do not send ResistLockpick value. If ResistLockpick is sent for unlocked objects, id panel shows bonus to Lockpick skill
                if (!wo.IsLocked && PropertiesInt.ContainsKey(PropertyInt.ResistLockpick))
                {
                    PropertiesInt.Remove(PropertyInt.ResistLockpick);
                }

                // If wo is locked, append skill check percent, as int, to properties for id panel display on chances of success
                if (wo.IsLocked)
                {
                    var resistLockpick = LockHelper.GetResistLockpick(wo);

                    if (resistLockpick != null)
                    {
                        PropertiesInt[PropertyInt.ResistLockpick] = (int)resistLockpick;

                        var pickSkill = examiner.Skills[Skill.Lockpick].Current;

                        var successChance = SkillCheck.GetSkillChance((int)pickSkill, (int)resistLockpick) * 100;

                        if (!PropertiesInt.ContainsKey(PropertyInt.AppraisalLockpickSuccessPercent))
                        {
                            PropertiesInt.Add(PropertyInt.AppraisalLockpickSuccessPercent, (int)successChance);
                        }
                    }
                }
            }

            if (wo is Corpse)
            {
                PropertiesBool.Clear();
                PropertiesDID.Clear();
                PropertiesFloat.Clear();
                PropertiesInt64.Clear();

                var discardInts = PropertiesInt.Where(x => x.Key != PropertyInt.EncumbranceVal && x.Key != PropertyInt.Value).Select(x => x.Key).ToList();
                foreach (var key in discardInts)
                {
                    PropertiesInt.Remove(key);
                }
                var discardString = PropertiesString.Where(x => x.Key != PropertyString.LongDesc).Select(x => x.Key).ToList();
                foreach (var key in discardString)
                {
                    PropertiesString.Remove(key);
                }
            }

            if (wo is Portal)
            {
                if (PropertiesInt.ContainsKey(PropertyInt.EncumbranceVal))
                {
                    PropertiesInt.Remove(PropertyInt.EncumbranceVal);
                }
            }

            if (wo is SlumLord slumLord)
            {
                PropertiesBool.Clear();
                PropertiesDID.Clear();
                PropertiesFloat.Clear();
                PropertiesIID.Clear();
                //PropertiesInt.Clear();
                PropertiesInt64.Clear();
                PropertiesString.Clear();

                var longDesc = "";

                if (slumLord.HouseOwner.HasValue && slumLord.HouseOwner.Value > 0)
                {
                    longDesc = $"The current maintenance has {(slumLord.IsRentPaid() || !PropertyManager.GetBool("house_rent_enabled").Item ? "" : "not ")}been paid.\n";

                    PropertiesInt.Clear();
                }
                else
                {
                    //longDesc = $"This house is {(slumLord.HouseStatus == HouseStatus.Disabled ? "not " : "")}available for purchase.\n"; // this was the retail msg.
                    longDesc = $"This {(slumLord.House.HouseType == HouseType.Undef ? "house" : slumLord.House.HouseType.ToString().ToLower())} is {(slumLord.House.HouseStatus == HouseStatus.Disabled ? "not " : "")}available for purchase.\n";

                    var discardInts = PropertiesInt.Where(x => x.Key != PropertyInt.HouseStatus && x.Key != PropertyInt.HouseType && x.Key != PropertyInt.MinLevel && x.Key != PropertyInt.MaxLevel && x.Key != PropertyInt.AllegianceMinLevel && x.Key != PropertyInt.AllegianceMaxLevel).Select(x => x.Key).ToList();
                    foreach (var key in discardInts)
                    {
                        PropertiesInt.Remove(key);
                    }
                }

                if (slumLord.HouseRequiresMonarch)
                {
                    longDesc += "You must be a monarch to purchase and maintain this dwelling.\n";
                }

                if (slumLord.AllegianceMinLevel.HasValue)
                {
                    var allegianceMinLevel = PropertyManager.GetLong("mansion_min_rank", -1).Item;
                    if (allegianceMinLevel == -1)
                    {
                        allegianceMinLevel = slumLord.AllegianceMinLevel.Value;
                    }

                    longDesc += $"Restricted to characters of allegiance rank {allegianceMinLevel} or greater.\n";
                }

                PropertiesString.Add(PropertyString.LongDesc, longDesc);
            }

            if (wo is Storage)
            {
                var longDesc = "";

                if (wo.HouseOwner.HasValue && wo.HouseOwner.Value > 0)
                {
                    longDesc = $"Owned by {wo.ParentLink.HouseOwnerName}\n";
                }

                var discardString = PropertiesString.Where(x => x.Key != PropertyString.Use).Select(x => x.Key).ToList();
                foreach (var key in discardString)
                {
                    PropertiesString.Remove(key);
                }

                PropertiesString.Add(PropertyString.LongDesc, longDesc);

                if (PropertiesInt.ContainsKey(PropertyInt.Value))
                {
                    PropertiesInt[PropertyInt.Value] = wo.Biota.GetProperty(PropertyInt.Value, wo.BiotaDatabaseLock) ?? 200; // Value is masked to base value of Storage
                }
            }

            if (wo is Hook)
            {
                // If the hook has any inventory, we need to send THOSE properties instead.
                var hook = wo as Container;

                string baseDescString = "";
                if (wo.ParentLink.HouseOwner != null)
                {
                    // This is for backwards compatibility. This value was not set/saved in earlier versions.
                    // It will get the player's name and save that to the HouseOwnerName property of the house. This is now done when a player purchases a house.
                    if (wo.ParentLink.HouseOwnerName == null)
                    {
                        var houseOwnerPlayer = PlayerManager.FindByGuid((uint)wo.ParentLink.HouseOwner);
                        if (houseOwnerPlayer != null)
                        {
                            wo.ParentLink.HouseOwnerName = houseOwnerPlayer.Name;
                            wo.ParentLink.SaveBiotaToDatabase();
                        }
                    }
                    baseDescString = "This hook is owned by " + wo.ParentLink.HouseOwnerName + ". "; //if house is owned, display this text
                }

                var containsString = "";
                if (hook.Inventory.Count == 1)
                {
                    WorldObject hookedItem = hook.Inventory.First().Value;

                    // Hooked items have a custom "description", containing the desc of the sub item and who the owner of the house is (if any)
                    BuildProfile(hookedItem, examiner, success);

                    containsString = "It contains: \n";

                    if (PropertiesString.ContainsKey(PropertyString.LongDesc) && PropertiesString[PropertyString.LongDesc] != null)
                    {
                        containsString += PropertiesString[PropertyString.LongDesc];
                    }
                    else if (PropertiesString.ContainsKey(PropertyString.ShortDesc) && PropertiesString[PropertyString.ShortDesc] != null)
                    {
                        containsString += PropertiesString[PropertyString.ShortDesc];
                    }
                    else
                    {
                        containsString += PropertiesString[PropertyString.Name];
                    }

                    BuildHookProfile(hookedItem);
                }

                if (PropertiesString.ContainsKey(PropertyString.LongDesc) && PropertiesString[PropertyString.LongDesc] != null)
                {
                    PropertiesString[PropertyString.LongDesc] = baseDescString + containsString;
                }
                else if (PropertiesString.ContainsKey(PropertyString.ShortDesc) && PropertiesString[PropertyString.ShortDesc] != null)
                {
                    PropertiesString[PropertyString.LongDesc] = baseDescString + containsString;
                }
                else
                {
                    PropertiesString[PropertyString.LongDesc] = baseDescString + containsString;
                }
            }

            if (wo is ManaStone)
            {
                var useMessage = "";

                if (wo.ItemCurMana.HasValue)
                {
                    useMessage = "Use on a magic item to give the stone's stored Mana to that item.";
                }
                else
                {
                    useMessage = "Use on a magic item to destroy that item and drain its Mana.";
                }

                PropertiesString[PropertyString.Use] = useMessage;
            }

            if (wo is CraftTool && wo.ItemType == ItemType.TinkeringMaterial)
            {
                if (PropertiesInt.ContainsKey(PropertyInt.Structure))
                {
                    PropertiesInt.Remove(PropertyInt.Structure);
                }
            }

            BuildFlags();
        }
Пример #46
0
    // turn on the type of camera we need for this conversation step
    static public void SetUpNewCamera(Dialogue.DialogueData.DialoguePointCamera conversation, CharacterModel inputCaller, List <Dialogue.DialogueData.DialoguePoint> dialoguePoints)
    {
        if (null == conversation.camera)
        {
            return;
        }

        CameraLerp cameraLerp = (null != conversation.cameraLerpOverride) ? conversation.cameraLerpOverride : GlobalDialogueData.Instance.defaultDialogueLerp;

        System.Type cameraType = conversation.camera.GetType();
        if (typeof(GameCameraParams) == cameraType)
        {
            if (null != Camera.main)
            {
                CameraBase cameraComponent = Camera.main.GetComponent <CameraBase>();

                GameCameraParams gameCameraParams = (GameCameraParams)conversation.camera;
                switch (conversation.targets)
                {
                case Dialogue.DialogueData.DialoguePointCamera.CameraTargets.localPlayer:
                    if (gameCameraParams.gameCamera)
                    {
                        cameraComponent.EnterFixedOffsetGameCamera(cameraLerp);
                    }
                    else
                    {
                        PlayerController controller = PlayerManager.LocalPlayerController();
                        if (null != controller)
                        {
                            List <GameObject> target = new List <GameObject>();
                            target.Add(controller.gameObject);
                            cameraComponent.EnterInteractionCamera(ref target, ref gameCameraParams, cameraLerp);
                        }
                    }
                    break;

                case Dialogue.DialogueData.DialoguePointCamera.CameraTargets.all:
                    List <GameObject> targets = new List <GameObject>();
                    Interaction.GetAllInteractionParticipants(ref targets, dialoguePoints);
                    if (targets.Count > 0)
                    {
                        cameraComponent.EnterInteractionCamera(ref targets, ref gameCameraParams, cameraLerp);
                    }
                    break;

                case Dialogue.DialogueData.DialoguePointCamera.CameraTargets.caller:
                    GameObject caller = GlobalUtils.FindCharacter(inputCaller);
                    if (null != caller)
                    {
                        if (inputCaller.isPlayer && gameCameraParams.gameCamera)
                        {
                            cameraComponent.EnterFixedOffsetGameCamera(cameraLerp);
                        }
                        else
                        {
                            List <GameObject> target = new List <GameObject>();
                            target.Add(caller);
                            cameraComponent.EnterInteractionCamera(ref target, ref gameCameraParams, cameraLerp);
                        }
                    }
                    break;

                default: break;
                }
            }
        }
        else if (typeof(CinematicCameraParams) == cameraType)
        {
            if (null != conversation.cinematic)
            {
                if (conversation.IsCinematicAPrefabRequiringInstantiation())
                {
                    GameObject cinematicObject = (GameObject)GameObject.Instantiate(conversation.cinematic);
                    if (null != cinematicObject && cinematicObject.activeInHierarchy)
                    {
                        Cinematic.Play(cinematicObject.GetComponent <Cinematic>(), PlayerManager.LocalPlayerGameObject());
                    }
                }
                else
                {
                    Cinematic.Play(conversation.cinematic.GetComponent <Cinematic>(), PlayerManager.LocalPlayerGameObject());
                }
            }
        }
    }
Пример #47
0
 void OnEnable()
 {
     playerInstance = this;
 }
Пример #48
0
 void Awake()
 {
     m_player = Object.FindObjectOfType <PlayerManager>().GetComponent <PlayerManager>();
 }
Пример #49
0
 public VehicleUndockingProcessor(PlayerManager playerManager, VehicleManager vehicleManager)
 {
     this.playerManager  = playerManager;
     this.vehicleManager = vehicleManager;
 }
Пример #50
0
 void Awake()
 {
     player       = FindObjectOfType <PlayerManager> ();
     shotCounter  = waitBTWShoot;
     objectPooler = GameObject.Find("SkeletonBoneObjectPool").GetComponent <ObjectPooler>();
 }
Пример #51
0
 private void Start()
 {
     //gameManager = GameManager.self;
     playerManager = GetComponent <PlayerManager>();
     playerNumber  = playerManager.playerMoveNumber;
 }
Пример #52
0
 void Start()
 {
     PM = transform.GetComponentInParent <PlayerManager>();
 }
Пример #53
0
    PlayerManager playerManager;   //We get a player reference so that we can add to the player health total (which is where health is stored)

    void Awake()
    {
        playerManager = FindObjectOfType <PlayerManager>();  //Find the Game Manager
    }
Пример #54
0
 private void Start()
 {
     equipmentManager = EquipmentManager.instance;
     playerManager    = PlayerManager.instance;
     statDetail       = StatDetai.instance;
 }
Пример #55
0
 void Awake()
 {
     player = FindObjectOfType <PlayerManager>();
 }
Пример #56
0
 public PlayerBaseState(ObjectManager curObject) : base(curObject)
 {
     stateName      = "PLAYER_BASE_STATE";
     this.curObject = curObject;
     curPlayer      = (PlayerManager)this.curObject;
 }
Пример #57
0
        /// <summary>
        /// Called when a player dies, in conjunction with Die()
        /// </summary>
        /// <param name="lastDamager">The last damager that landed the death blow</param>
        /// <param name="damageType">The damage type for the death message</param>
        public override DeathMessage OnDeath(WorldObject lastDamager, DamageType damageType, bool criticalHit = false)
        {
            if (DamageHistory.TopDamager is Player pkPlayer)
            {
                if (IsPKDeath(pkPlayer))
                {
                    pkPlayer.PkTimestamp = Time.GetUnixTime();
                    pkPlayer.PlayerKillsPk++;

                    var globalPKDe = $"{lastDamager.Name} has defeated {Name}!";

                    if ((Location.Cell & 0xFFFF) < 0x100)
                    {
                        globalPKDe += $" The kill occured at {Location.GetMapCoordStr()}";
                    }

                    globalPKDe += "\n[PKDe]";

                    PlayerManager.BroadcastToAll(new GameMessageSystemChat(globalPKDe, ChatMessageType.Broadcast));
                }
                else if (IsPKLiteDeath(pkPlayer))
                {
                    pkPlayer.PlayerKillsPkl++;
                }
            }

            var deathMessage = base.OnDeath(lastDamager, damageType, criticalHit);

            if (lastDamager != null)
            {
                lastDamager.EmoteManager.OnKill(this);
            }

            var playerMsg = "";

            if (lastDamager != null)
            {
                playerMsg = string.Format(deathMessage.Victim, Name, lastDamager.Name);
            }
            else
            {
                playerMsg = deathMessage.Victim;
            }

            var msgYourDeath = new GameEventYourDeath(Session, playerMsg);

            Session.Network.EnqueueSend(msgYourDeath);

            // broadcast to nearby players
            var nearbyMsg = "";

            if (lastDamager != null)
            {
                nearbyMsg = string.Format(deathMessage.Broadcast, Name, lastDamager.Name);
            }
            else
            {
                nearbyMsg = deathMessage.Broadcast;
            }

            var broadcastMsg = new GameMessageSystemChat(nearbyMsg, ChatMessageType.Broadcast);

            log.Info(nearbyMsg);

            var excludePlayers = new List <Player>();

            if (lastDamager is Player lastDamagerPlayer)
            {
                excludePlayers.Add(lastDamagerPlayer);
            }

            var nearbyPlayers = EnqueueBroadcast(excludePlayers, false, broadcastMsg);

            excludePlayers.AddRange(nearbyPlayers);
            excludePlayers.Add(this);   // exclude self

            if (Fellowship != null)
            {
                Fellowship.OnDeath(this);
            }

            // if the player's lifestone is in a different landblock, also broadcast their demise to that landblock
            if (Sanctuary != null && Location.Landblock != Sanctuary.Landblock)
            {
                // ActionBroadcastKill might not work if other players around lifestone aren't aware of this player yet...
                // this existing broadcast method is also based on the current visible objects to the player,
                // and the player hasn't entered portal space or teleported back to the lifestone yet, so this doesn't work
                //ActionBroadcastKill(nearbyMsg, Guid, lastDamager.Guid);

                // instead, we get all of the players in the lifestone landblock + adjacent landblocks,
                // and possibly limit that to some radius around the landblock?
                var lifestoneBlock = LandblockManager.GetLandblock(new LandblockId(Sanctuary.Landblock << 16 | 0xFFFF), true);
                lifestoneBlock.EnqueueBroadcast(excludePlayers, true, broadcastMsg);
            }

            return(deathMessage);
        }
Пример #58
0
        public void DiscountPlayerItems()
        {
            bool          updEffect = false;
            uint          data_atual = uint.Parse(DateTime.Now.ToString("yyMMddHHmm"));
            List <object> removedItems = new List <object>();
            int           bonuses = _bonus != null ? _bonus.bonuses : 0, freepass = _bonus != null ? _bonus.freepass : 0;

            lock (_inventory._items)
            {
                for (int i = 0; i < _inventory._items.Count; i++)
                {
                    ItemsModel item = _inventory._items[i];
                    if (item._count <= data_atual & item._equip == 2)
                    {
                        if (item._category == 3)
                        {
                            if (_bonus == null)
                            {
                                continue;
                            }
                            bool changed = _bonus.RemoveBonuses(item._id);
                            if (!changed)
                            {
                                if (item._id == 1200014000)
                                {
                                    ComDiv.updateDB("player_bonus", "sightcolor", 4, "player_id", player_id);
                                    _bonus.sightColor = 4;
                                }
                                else if (item._id == 1200006000)
                                {
                                    ComDiv.updateDB("contas", "name_color", 0, "player_id", player_id);
                                    name_color = 0;
                                }
                                else if (item._id == 1200009000)
                                {
                                    ComDiv.updateDB("player_bonus", "fakerank", 55, "player_id", player_id);
                                    _bonus.fakeRank = 55;
                                }
                                else if (item._id == 1200010000)
                                {
                                    if (_bonus.fakeNick.Length > 0)
                                    {
                                        ComDiv.updateDB("player_bonus", "fakenick", "", "player_id", player_id);
                                        ComDiv.updateDB("contas", "player_name", _bonus.fakeNick, "player_id", player_id);
                                        player_name     = _bonus.fakeNick;
                                        _bonus.fakeNick = "";
                                    }
                                }
                            }
                            CupomFlag cupom = CupomEffectManager.getCupomEffect(item._id);
                            if (cupom != null && cupom.EffectFlag > 0 && effects.HasFlag(cupom.EffectFlag))
                            {
                                effects  -= cupom.EffectFlag;
                                updEffect = true;
                            }
                        }
                        removedItems.Add(item._objId);
                        _inventory._items.RemoveAt(i--);
                    }
                    else if (item._count == 0)
                    {
                        removedItems.Add(item._objId);
                        _inventory._items.RemoveAt(i--);
                    }
                }
                ComDiv.deleteDB("player_items", "id", removedItems.ToArray(), "owner_id", player_id);
            }
            removedItems = null;
            if (_bonus != null && (_bonus.bonuses != bonuses || _bonus.freepass != freepass))
            {
                PlayerManager.updatePlayerBonus(player_id, _bonus.bonuses, _bonus.freepass);
            }
            if (effects < 0)
            {
                effects = 0;
            }
            if (updEffect)
            {
                PlayerManager.updateCupomEffects(player_id, effects);
            }
            _inventory.LoadBasicItems();
            int type = PlayerManager.CheckEquipedItems(_equip, _inventory._items);

            if (type > 0)
            {
                DBQuery query = new DBQuery();
                if ((type & 2) == 2)
                {
                    PlayerManager.updateWeapons(_equip, query);
                }
                if ((type & 1) == 1)
                {
                    PlayerManager.updateChars(_equip, query);
                }
                ComDiv.updateDB("contas", "player_id", player_id, query.GetTables(), query.GetValues());
                query = null;
            }
        }
Пример #59
0
 void Start()
 {
     playerManager = PlayerManager.instance;
     myStats       = GetComponent <CharacterStats>();
 }
Пример #60
0
 /// <summary>
 /// Activar la habilidad, que puede ser en combate o fuera de él.
 /// Requiere que se le envíe el manager del jugador.
 /// </summary>
 /// <param name="player"></param>
 public virtual void ImplementHability(PlayerManager player, EnemyNPC npc)
 {
     AddExperience();
 }