Exemplo n.º 1
0
    /// <summary>
    /// Get a list Of character Identity (typically only one but could be two). Returns Empty list if a problem
    /// </summary>
    /// <returns></returns>
    public List <string> GetCharacterIdentity()
    {
        List <string>     listOfIdentity = new List <string>();
        int               rnd            = Random.Range(0, 100);
        CharacterIdentity identity       = arrayOfIdentityLookup[rnd];

        //check roll again
        if (identity.isRollAgain == true)
        {
            int counter = 0;
            do
            {
                rnd      = Random.Range(0, 100);
                identity = arrayOfIdentityLookup[rnd];
                if (identity.isRollAgain == false)
                {
                    listOfIdentity.Add(identity.tag);
                    counter++;
                }
            }while (counter < 2);
        }
        else
        {
            listOfIdentity.Add(identity.tag);
        }
        return(listOfIdentity);
    }
Exemplo n.º 2
0
    public void InitializeCharacter(CharacterIdentity ci)
    {
        characterIdentity = ci;
        trans             = model.GetComponent <Transform>();
        rigid             = GetComponent <Rigid>();

        mState      = new IdleState();
        mDelayState = new IdleDelayState();

        gameSystemState = SystemOrder.NOTHING;
        inputOrder      = InputOrder.stand;
        attackOrder     = -1;
        walkDirection   = new Vector3(0, 0, 0);
        sightRotation   = new Vector3(0, 0, 0);

        posture     = new Posture(this);
        walkPhase   = 0;
        attackPhase = 0;

        holdingItemIndex = -1;

        if (characterIdentity.isPlayer)
        {
            GetComponent <Basic>().mManager.allManager.SetCamera(gameObject);
            posture.BecomeInvisible();

            targetCharacter = null;
        }
        else
        {
            targetCharacter = GetComponent <Basic>().mManager.allManager.player;
        }
    }
Exemplo n.º 3
0
    public void SetNoumenon()
    {
        characterIdentity = CharacterIdentity.noumenon;
        identity          = "本体";
        rend         = GetComponentsInChildren <Renderer>();
        firstAction  = new List <Skill>();
        secondAction = new List <Skill>();
        skills       = new Dictionary <string, int>();

        firstAction.Add(SkillManager.GetInstance().skillList.Find(s => s.EName == "Move"));
        firstAction.Add(SkillManager.GetInstance().skillList.Find(s => s.EName == "SkillOrToolList"));
        firstAction.Add(SkillManager.GetInstance().skillList.Find(s => s.EName == "RestoreChakra"));
        firstAction.Add(SkillManager.GetInstance().skillList.Find(s => s.EName == "Rest"));
        firstAction.Add(SkillManager.GetInstance().skillList.Find(s => s.EName == "EndRound"));

        secondAction.Add(SkillManager.GetInstance().skillList.Find(s => s.EName == "SkillOrToolList"));
        secondAction.Add(SkillManager.GetInstance().skillList.Find(s => s.EName == "EndRound"));


        var characterData = XMLManager.GetInstance().characterDB.characterDataList.Find(d => d.roleEName == roleEName);

        foreach (var data in characterData.skills)
        {
            skills.Add(data.skillName, data.skillLevel);
        }

        for (int i = 0; i < characterData.items.Count; i++)
        {
            characterData.items[i].itemPosition = i;
            items.Add(characterData.items[i]);
        }

        attributes.Find(d => d.eName == "itemNum").value = items.Count;
    }
Exemplo n.º 4
0
        /// <summary>
        /// Validates the operation and closes the window.
        /// </summary>
        private void Complete()
        {
            if (m_creationArgs == null)
            {
                return;
            }

            m_apiKey = m_creationArgs.CreateOrUpdate();

            // Takes care of the ignore list
            foreach (ListViewItem item in CharactersListView.Items)
            {
                CharacterIdentity id = (CharacterIdentity)item.Tag;
                // If it's a newly created API key, character monitoring has been already been set
                // We only need to deal with those coming out of the ignore list
                if (item.Checked)
                {
                    if (m_apiKey.IdentityIgnoreList.Contains(id))
                    {
                        m_apiKey.IdentityIgnoreList.Remove(id);
                        id.CCPCharacter.Monitored = true;
                    }
                    continue;
                }

                // Add character in ignore list if not already
                if (!m_apiKey.IdentityIgnoreList.Contains(id))
                {
                    m_apiKey.IdentityIgnoreList.Add(id.CCPCharacter);
                }
            }

            // Closes the window
            Close();
        }
Exemplo n.º 5
0
 public override void Unpack(BinaryReader reader)
 {
     base.Unpack(reader);
     Status         = reader.ReadUInt32();
     CharacterCount = reader.ReadUInt32();
     Set.Clear();
     for (int i = 0; i < CharacterCount; i++)
     {
         CharacterIdentity newItem = new CharacterIdentity();
         newItem.Unpack(reader);
         Set.Add(newItem);
     }
     CharacterCount2 = reader.ReadUInt32();
     Delset.Clear();
     for (int i = 0; i < CharacterCount2; i++)
     {
         CharacterIdentity newItem = new CharacterIdentity();
         newItem.Unpack(reader);
         Delset.Add(newItem);
     }
     NumAllowedCharacters = reader.ReadUInt32();
     Account            = reader.ReadString16L();
     UseTurbineChat     = reader.ReadBool32();
     HasThroneofDestiny = reader.ReadBool32();
 }
Exemplo n.º 6
0
    public void SetBeastClone(Transform noumenon)
    {
        base.Initialize();

        attributes = new List <Attribute>();

        //序列化和反序列化进行深度复制。
        MemoryStream    stream    = new MemoryStream();
        BinaryFormatter formatter = new BinaryFormatter();

        formatter.Serialize(stream, noumenon.GetComponent <CharacterStatus>().attributes);
        stream.Position = 0;
        attributes      = formatter.Deserialize(stream) as List <Attribute>;

        characterIdentity = CharacterIdentity.beastClone;
        firstAction       = new List <Skill>();
        secondAction      = new List <Skill>();
        skills            = new Dictionary <string, int>();

        firstAction.Add(SkillManager.GetInstance().skillList.Find(s => s.EName == "Move"));
        firstAction.Add(SkillManager.GetInstance().skillList.Find(s => s.EName == "SkillOrToolList"));
        firstAction.Add(SkillManager.GetInstance().skillList.Find(s => s.EName == "EndRound"));

        secondAction.Add(SkillManager.GetInstance().skillList.Find(s => s.EName == "SkillOrToolList"));
        secondAction.Add(SkillManager.GetInstance().skillList.Find(s => s.EName == "EndRound"));

        var characterData = XMLManager.GetInstance().characterDB.characterDataList.Find(d => d.roleEName == roleEName);

        foreach (var data in characterData.skills)
        {
            skills.Add(data.skillName, data.skillLevel);
        }
    }
Exemplo n.º 7
0
        public Character(CharacterIdentity identity)
        {
            this.Id            = identity.Id;
            this.Name          = identity.Name;
            this.mainCharacter = new Lazy <Character>(() => this.SetMain(identity.Main));
            this.Server        = StorageService.Servers.First(server => server.Id == identity.Realm);
            this.Region        = identity.Region;

            this.SetProfileUrls();
        }
Exemplo n.º 8
0
        public static CharacterIdentity read(BinaryReader binaryReader)
        {
            CharacterIdentity newObj = new CharacterIdentity();

            newObj.gid_              = binaryReader.ReadUInt32();
            newObj.name_             = PStringChar.read(binaryReader);
            newObj.secondsGreyedOut_ = binaryReader.ReadUInt32();

            return(newObj);
        }
Exemplo n.º 9
0
        public static CharacterIdentity read(BinaryReader binaryReader)
        {
            CharacterIdentity newObj = new CharacterIdentity();
            var startPosition        = binaryReader.BaseStream.Position;

            newObj.gid_              = binaryReader.ReadUInt32();
            newObj.name_             = PStringChar.read(binaryReader);
            newObj.secondsGreyedOut_ = binaryReader.ReadUInt32();
            newObj.Length            = (int)(binaryReader.BaseStream.Position - startPosition);
            return(newObj);
        }
Exemplo n.º 10
0
        /// <summary>
        /// Creates the character.
        /// </summary>
        public UriCharacter CreateCharacter()
        {
            CharacterIdentity identity = GetIdentity(m_result);

            // Instantiates characters, adds, notify
            var uriCharacter = m_apiResult != null ? new UriCharacter(identity, Uri, m_apiResult) :
                               new UriCharacter(identity, Uri, m_result as SerializableSettingsCharacter);

            EveMonClient.Characters.Add(uriCharacter);

            return(uriCharacter);
        }
Exemplo n.º 11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="APIKeyCreationEventArgs"/> class.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <param name="verificationCode">The verification code.</param>
        /// <param name="apiKeyInfo">The API key info.</param>
        /// <exception cref="System.ArgumentNullException">apiKeyInfo</exception>
        public APIKeyCreationEventArgs(long id, string verificationCode,
                                       CCPAPIResult <SerializableAPIKeyInfo> apiKeyInfo)
        {
            apiKeyInfo.ThrowIfNull(nameof(apiKeyInfo));

            ID = id;
            VerificationCode = verificationCode;
            KeyTestError     = String.Empty;
            APIKeyInfo       = apiKeyInfo;
            Identities       = new Collection <CharacterIdentity>();

            // Determine the API key type
            Type = APIKey.GetCredentialsType(apiKeyInfo);

            // On error, retrieve the error message and quit
            if (Type == CCPAPIKeyType.Unknown)
            {
                KeyTestError = apiKeyInfo.ErrorMessage;
                CCPError     = apiKeyInfo.CCPError ?? new CCPAPIError();
                return;
            }

            AccessMask = apiKeyInfo.Result.Key.AccessMask;
            Expiration = apiKeyInfo.Result.Key.Expiration;

            // Retrieves the characters list
            foreach (SerializableCharacterListItem character in apiKeyInfo.Result.Key.Characters)
            {
                // Look for an existing character ID and update its name
                CharacterIdentity identity = EveMonClient.CharacterIdentities[character.ID];
                if (identity != null)
                {
                    identity.CharacterName   = character.Name;
                    identity.CorporationID   = character.CorporationID;
                    identity.CorporationName = character.CorporationName;
                    identity.AllianceID      = character.AllianceID;
                    identity.AllianceName    = character.AllianceName;
                    identity.FactionID       = character.FactionID;
                    identity.FactionName     = character.FactionName;
                }
                else
                {
                    // Create an identity if necessary
                    identity = EveMonClient.CharacterIdentities.Add(character.ID, character.Name,
                                                                    character.CorporationID, character.CorporationName,
                                                                    character.AllianceID, character.AllianceName,
                                                                    character.FactionID, character.FactionName);
                }

                Identities.Add(identity);
            }
        }
Exemplo n.º 12
0
        private async Task SetupMumble()
        {
            startLabel.SetPropertyThreadSafe("Text", "Waiting for Mumble Link . . .");
            planningLabel.SetPropertyThreadSafe("Text", "Waiting for Mumble Link . . .");

            mumble = new MumbleHandler();
            await mumble.WaitForActive();

            identity = mumble.GetIdentity();

            startLabel.SetPropertyThreadSafe("Text", $"Mumble Link active for {identity.name}");
            liveStartButton.SetPropertyThreadSafe("Enabled", true);
        }
Exemplo n.º 13
0
 public Transform GetCharacterTransform(CharacterIdentity identity)
 {
     if (identity == CharacterIdentity.Junior)
     {
         return(junior.transform);
     }
     else if (identity == CharacterIdentity.Senior)
     {
         return(senior.transform);
     }
     else
     {
         return(null);
     }
 }
Exemplo n.º 14
0
    public void SetTransfiguration()
    {
        characterIdentity = CharacterIdentity.transfiguration;
        identity          = "变化";
        rend         = GetComponentsInChildren <Renderer>();
        firstAction  = new List <Skill>();
        secondAction = new List <Skill>();
        skills       = new Dictionary <string, int>();

        firstAction.Add(SkillManager.GetInstance().skillList.Find(s => s.EName == "Move"));
        firstAction.Add(SkillManager.GetInstance().skillList.Find(s => s.EName == "RestoreChakra"));
        firstAction.Add(SkillManager.GetInstance().skillList.Find(s => s.EName == "Rest"));
        firstAction.Add(SkillManager.GetInstance().skillList.Find(s => s.EName == "EndRound"));

        skills.Add("NinjaCombo", 1);
    }
Exemplo n.º 15
0
    public void CreateCharacterObject(GameObject instance, CharacterIdentity ci, int x, int y, int z)
    {
        GameObject createdObject = CreateGameObject(instance, x, y, z);

        if (createdObject != null)
        {
            createdObject.GetComponent <Basic>().Initialize(this, x, y, z);
            createdObject.GetComponent <Character>().InitializeCharacter(ci);

            ItemBox itemBox;
            if (itemBox = createdObject.GetComponent <ItemBox>())
            {
                itemBox.InitializeItemBox(54);
            }
        }
    }
Exemplo n.º 16
0
 public void PickUp(CharacterIdentity identity, Transform transform)
 {
     if (IsFulfillRequest())
     {
         return;
     }
     preparedPlayers.Add(identity);
     Debug.Log(objectInfo.name + "'s prepared:" + IsFulfillRequest().ToString());
     if (preparedPlayers.Count == 1)
     {
         anchor.SetAnchor(GameManager.instance.GetCharacterTransform(identity));
     }
     else if (preparedPlayers.Count > 1)
     {
         GameManager.instance.GetCharacterTransform(identity).GetComponent <PlayerStatus>().SetAnchor(anchor.target);
     }
 }
Exemplo n.º 17
0
        /// <summary>
        /// Updates the given character.
        /// </summary>
        /// <param name="character"></param>
        /// <exception cref="System.ArgumentNullException">character</exception>
        public void UpdateCharacter(UriCharacter character)
        {
            character.ThrowIfNull(nameof(character));

            CharacterIdentity identity = GetIdentity(m_result);

            // Updates
            if (m_apiResult != null)
            {
                character.Update(identity, Uri, m_apiResult);
            }
            else
            {
                SerializableCCPCharacter ccpCharacter = m_result as SerializableCCPCharacter;
                character.Update(identity, Uri, ccpCharacter);
            }
        }
Exemplo n.º 18
0
    public void PutDown(CharacterIdentity identity)
    {
        objectInfo.IsInteractable = true;
        if (preparedPlayers.Contains(identity))
        {
            preparedPlayers.Remove(identity);
            GameManager.instance.GetCharacterTransform(identity).GetComponent <PlayerStatus>().ResetAnchor();
        }

        if (preparedPlayers.Count > 0)
        {
            Debug.Log("PutDown, remain:" + preparedPlayers[0].ToString());
            GameManager.instance.GetCharacterTransform(preparedPlayers[0]).GetComponent <PlayerStatus>().ResetAnchor();
            anchor.SetAnchor(GameManager.instance.GetCharacterTransform(preparedPlayers[0]));
        }
        else
        {
            anchor.ResetAnchor();
        }
    }
Exemplo n.º 19
0
        /// <summary>
        /// Imports the character identities from a serialization object.
        /// </summary>
        /// <param name="serial"></param>
        internal void Import(IEnumerable <SerializableSettingsCharacter> serial)
        {
            // Clear the API key on every identity
            foreach (CharacterIdentity id in EveMonClient.CharacterIdentities)
            {
                id.APIKeys.Clear();
            }

            // Unsubscribe any event handlers in character
            foreach (Character character in Items)
            {
                character.Dispose();
            }

            // Import the characters, their identies, etc
            Items.Clear();
            foreach (SerializableSettingsCharacter serialCharacter in serial)
            {
                // Gets the identity or create it
                CharacterIdentity id = EveMonClient.CharacterIdentities[serialCharacter.ID] ??
                                       EveMonClient.CharacterIdentities.Add(serialCharacter.ID, serialCharacter.Name,
                                                                            serialCharacter.CorporationID, serialCharacter.CorporationName,
                                                                            serialCharacter.AllianceID, serialCharacter.AllianceName,
                                                                            serialCharacter.FactionID, serialCharacter.FactionName);

                // Imports the character
                SerializableCCPCharacter ccpCharacter = serialCharacter as SerializableCCPCharacter;
                if (ccpCharacter != null)
                {
                    Items.Add(new CCPCharacter(id, ccpCharacter));
                }
                else
                {
                    SerializableUriCharacter uriCharacter = serialCharacter as SerializableUriCharacter;
                    Items.Add(new UriCharacter(id, uriCharacter));
                }
            }

            // Notify the change
            EveMonClient.OnCharacterCollectionChanged();
        }
Exemplo n.º 20
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ESIKeyCreationEventArgs"/> class.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <param name="refreshToken">The refresh token.</param>
        /// <param name="charInfo">The ESI key info.</param>
        /// <exception cref="System.ArgumentNullException">charInfo</exception>
        public ESIKeyCreationEventArgs(long id, string refreshToken, JsonResult <EsiAPITokenInfo> charInfo)
        {
            charInfo.ThrowIfNull(nameof(charInfo));

            ID           = id;
            RefreshToken = refreshToken;
            // TODO
            AccessMask = ulong.MaxValue;

            if (charInfo.HasError)
            {
                CCPError = new CCPAPIError()
                {
                    ErrorCode    = charInfo.ResponseCode,
                    ErrorMessage = charInfo.ErrorMessage ??
                                   "No character result retrieved from ESI key"
                }
            }
            ;
            else
            {
                EsiAPITokenInfo result = charInfo.Result;
                CCPError = null;
                long   charId = result.CharacterID;
                string name   = result.CharacterName;

                // Only one character per ESI key
                // Look for an existing character ID and update its name
                CharacterIdentity identity = EveMonClient.CharacterIdentities[charId];
                if (identity != null)
                {
                    identity.CharacterName = name;
                }
                else
                {
                    // Create an identity if necessary
                    identity = EveMonClient.CharacterIdentities.Add(charId, name);
                }
                Identity = identity;
            }
        }
        public void LoadContent(Vector2 position, CharacterIdentity playerID)
        {
            this.characterID = playerID;
            this.position = position;
            this.CollisionBoxes = new Dictionary<MapCharacterAction, CollisionBox>();

            controls = new GamePadController(PlayerIndex.One);
            debugControls = new KeyboardController();

            MapCharacterData characterData = GameClass.ContentManager.Load<MapCharacterData>(@"MapCharacters/" + playerID.ToString() + "/" + playerID.ToString() + "Map");

            Sprites.Add(MapCharacterAction.Idle, AnimatedSprite.CreateFromData(characterData.idleSpriteData));
            Sprites.Add(MapCharacterAction.Run, AnimatedSprite.CreateFromData(characterData.runSpriteData));
            Sprites.Add(MapCharacterAction.Jump, AnimatedSprite.CreateFromData(characterData.jumpSpriteData));
            Sprites.Add(MapCharacterAction.Fall, AnimatedSprite.CreateFromData(characterData.fallSpriteData));
            Sprites.Add(MapCharacterAction.Land, AnimatedSprite.CreateFromData(characterData.landSpriteData));

            CollisionBoxes = new Dictionary<MapCharacterAction, CollisionBox>();
            CollisionBoxes.Add(MapCharacterAction.Idle, CollisionBox.CreateFromData(characterData.idleSpriteData.collisionBoxData));
            CollisionBoxes.Add(MapCharacterAction.Run, CollisionBox.CreateFromData(characterData.runSpriteData.collisionBoxData));
            CollisionBoxes.Add(MapCharacterAction.Jump, CollisionBox.CreateFromData(characterData.jumpSpriteData.collisionBoxData));
            CollisionBoxes.Add(MapCharacterAction.Fall, CollisionBox.CreateFromData(characterData.fallSpriteData.collisionBoxData));
            CollisionBoxes.Add(MapCharacterAction.Land, CollisionBox.CreateFromData(characterData.landSpriteData.collisionBoxData));

            CollisionSensors.Add(SensorType.Top, new CollisionSensor(CollisionBoxes[MapCharacterAction.Idle], SensorType.Top, 4));
            CollisionSensors.Add(SensorType.Bottom, new CollisionSensor(CollisionBoxes[MapCharacterAction.Idle], SensorType.Bottom, 4));
            CollisionSensors.Add(SensorType.Left, new CollisionSensor(CollisionBoxes[MapCharacterAction.Idle], SensorType.Left, 4));
            CollisionSensors.Add(SensorType.Right, new CollisionSensor(CollisionBoxes[MapCharacterAction.Idle], SensorType.Right, 4));

            portraitTexture = GameClass.ContentManager.Load<Texture2D>(characterData.portraitTextureName);
            walkSpeed = characterData.walkSpeed;
            airInfluence = characterData.airInfluence;
            currentFrictionFactor = characterData.frictionFactor;
            jumpStrength = characterData.jumpStrength;
            mass = characterData.mass;

            CurrentAction = MapCharacterAction.Idle;
            currentCollisionBox = CollisionBoxes[CurrentAction];
        }
Exemplo n.º 22
0
    public void SetClone(Transform noumenon)
    {
        base.Initialize();
        identity   = "分身";
        attributes = new List <Attribute>();

        //序列化和反序列化进行深度复制。
        MemoryStream    stream    = new MemoryStream();
        BinaryFormatter formatter = new BinaryFormatter();

        formatter.Serialize(stream, noumenon.GetComponent <CharacterStatus>().attributes);
        stream.Position = 0;
        attributes      = formatter.Deserialize(stream) as List <Attribute>;

        characterIdentity = CharacterIdentity.clone;
        firstAction       = new List <Skill>();
        secondAction      = new List <Skill>();
        skills            = new Dictionary <string, int>();

        firstAction.Add(SkillManager.GetInstance().skillList.Find(s => s.EName == "Move"));
        firstAction.Add(SkillManager.GetInstance().skillList.Find(s => s.EName == "EndRound"));
    }
Exemplo n.º 23
0
        public static Login__CharacterSet read(BinaryReader binaryReader)
        {
            Login__CharacterSet newObj = new Login__CharacterSet();

            newObj.status_ = binaryReader.ReadUInt32();
            uint setNum = binaryReader.ReadUInt32();

            for (uint i = 0; i < setNum; ++i)
            {
                newObj.set_.Add(CharacterIdentity.read(binaryReader));
            }
            uint delSetNum = binaryReader.ReadUInt32();

            for (uint i = 0; i < delSetNum; ++i)
            {
                newObj.delSet_.Add(CharacterIdentity.read(binaryReader));
            }
            newObj.numAllowedCharacters_ = binaryReader.ReadUInt32();
            newObj.account_              = PStringChar.read(binaryReader);
            newObj.m_fUseTurbineChat     = binaryReader.ReadUInt32();
            newObj.m_fHasThroneofDestiny = binaryReader.ReadUInt32();

            return(newObj);
        }
Exemplo n.º 24
0
        public void LoadContent(PlayerStatsData growthStats, int level, int expToNext, int pointsToSpend, int HP, int MP, int ATK, int DEF, int MAG_ATK, int MAG_DEF, int SPD)
        {
            this.characterID = growthStats.characterID;
            portraitTexture = GameClass.LoadTextureData(growthStats.portraitTextureFileName);
            this.level = level;
            this.expToNext = expToNext;
            this.pointsToSpend = pointsToSpend;
            hp = HP;
            mp = MP;
            atk = ATK;
            def = DEF;
            mag_atk = MAG_ATK;
            mag_def = MAG_DEF;
            spd = SPD;
            hpGrowth = growthStats.HPGrowth;
            mpGrowth = growthStats.MPGrowth;
            atkGrowth = growthStats.ATKGrowth;
            defGrowth = growthStats.DEFGrowth;
            mag_atkGrowth = growthStats.MAG_ATKGrowth;
            mag_defGrowth = growthStats.MAG_DEFGrowth;
            spdGrowth = growthStats.SPDGrowth;

            techniqueLevelData = growthStats.techniqueLevelData;
        }
Exemplo n.º 25
0
 public static PlayerStatsData GetPlayerStatsData(CharacterIdentity characterID)
 {
     foreach (PlayerStatsData playerStatsData in playerStatsList)
     {
         if (playerStatsData.characterID == characterID)
         {
             return playerStatsData;
         }
     }
     throw new Exception("No Player Stats Found for " + characterID.ToString() + ". Please update PlayerStatsList.xml");
 }
Exemplo n.º 26
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="identity"></param>
 public CharacterIdentityChangedEventArgs(CharacterIdentity identity)
 {
     CharacterIdentity = identity;
 }
Exemplo n.º 27
0
        public void LoadConversation(PlayerMapCharacter player, NPCMapCharacter NPCConversationTrigger)
        {
            autoDialog = false;
            this.player = player;
            this.NPCTriggerID = NPCConversationTrigger.CharacterID;

            topDialogBox = new DialogBox(new Vector2(GameClass.CurrentGameCamera.Position.X + GameClass.ViewPortBounds.Width / 2, GameClass.CurrentGameCamera.Position.Y + 90));
            bottomDialogBox = new DialogBox(new Vector2(GameClass.CurrentGameCamera.Position.X + GameClass.ViewPortBounds.Width / 2, GameClass.CurrentGameCamera.Position.Y + 190));
            currentSentenceIndex = 0;
            currentSentenceOrderID = 0;
            inputIconTexture = GameClass.LoadTextureData("General/BButton");
            inputIconAlpha = 0.0f;
            inputIconState = InputIconState.Hidden;
            inputFlashDirection = 0;

            currentState = DialogManagerState.IdleHidden;

            player.CurrentAction = MapCharacterAction.Idle;

            topDialogBox.DialogCharacter = NPCConversationTrigger.CharacterID;
            topDialogBox.PortraitTexture = NPCConversationTrigger.PortraitTexture;

            bottomDialogBox.DialogCharacter = player.CharacterID;
            bottomDialogBox.PortraitTexture = player.PortraitTexture;

            screenCoverTexture = GameClass.LoadTextureData("Black");
            screenCoverAlpha = 0.0f;

            bool convoTriggered = false;
            foreach(QuestDialogData dialogData in NPCConversationTrigger.LinkedNPCData.dialog)
            {
                if (dialogData.flagsToTrigger != null)
                {
                    int triggerCount = dialogData.flagsToTrigger.Count;
                    int flagsTriggered = 0;
                    foreach (QuestFlagData flagTriggerRequirement in dialogData.flagsToTrigger)
                    {
                        if (GlobalGameInfo.CheckFlagTrigger(dialogData.flagsToTrigger) == true)
                        {
                            flagsTriggered += 1;
                        }
                    }

                    if (flagsTriggered == triggerCount)
                    {
                        convoTriggered = true;
                        currentConversation = dialogData;
                        break;
                    }
                }
                else
                {
                    convoTriggered = true;
                    currentConversation = dialogData;
                    break;
                }
            }

            if (convoTriggered == false)
            {
                throw new Exception("no conversation found.");
            }
            else
            {

                currentSentenceIndex = 0;
                currentSentenceOrderID = 0;
                currentState = DialogManagerState.BeginShowDialog;
            }
        }
Exemplo n.º 28
0
        public void LoadConversation(PlayerMapCharacter player, QuestDialogData questDialogData)
        {
            autoDialog = true;
            this.player = player;

            foreach (QuestDialogSentenceData sentence in questDialogData.sentences)
            {
                if (sentence.characterTalking != player.CharacterID)
                {
                    this.NPCTriggerID = sentence.characterTalking;
                    break;
                }
            }

            topDialogBox = new DialogBox(new Vector2(GameClass.CurrentGameCamera.Position.X + GameClass.ViewPortBounds.Width / 2, GameClass.CurrentGameCamera.Position.Y + 90));
            bottomDialogBox = new DialogBox(new Vector2(GameClass.CurrentGameCamera.Position.X + GameClass.ViewPortBounds.Width / 2, GameClass.CurrentGameCamera.Position.Y + 190));
            currentSentenceIndex = 0;
            currentSentenceOrderID = 0;
            inputIconTexture = GameClass.LoadTextureData("General/BButton");
            inputIconAlpha = 0.0f;
            inputIconState = InputIconState.Hidden;
            inputFlashDirection = 0;

            currentState = DialogManagerState.IdleHidden;

            topDialogBox.DialogCharacter = NPCTriggerID;
            topDialogBox.PortraitTexture = GameClass.LoadTextureData("MapCharacters/" + NPCTriggerID.ToString() + "/" + NPCTriggerID.ToString() + "Portrait");

            bottomDialogBox.DialogCharacter = player.CharacterID;
            bottomDialogBox.PortraitTexture = player.PortraitTexture;

            screenCoverTexture = GameClass.LoadTextureData("Black");
            screenCoverAlpha = 0.0f;

            currentConversation = questDialogData;

            currentSentenceIndex = 0;
            currentSentenceOrderID = 0;
            currentState = DialogManagerState.BeginShowDialog;
        }
Exemplo n.º 29
0
        public void LoadContent(PlayerStatsData initialStats)
        {
            this.characterID = initialStats.characterID;
            portraitTexture = GameClass.LoadTextureData(initialStats.portraitTextureFileName);
            this.level = initialStats.initialLevel;
            this.expToNext = level * 5;
            this.pointsToSpend = 0;

            hp = initialStats.initialHP;
            mp = initialStats.initialMP;
            atk = initialStats.initialATK;
            def = initialStats.initialDEF;
            mag_atk = initialStats.initialMAG_ATK;
            mag_def = initialStats.initialMAG_DEF;
            spd = initialStats.initialSPD;

            hpGrowth = initialStats.HPGrowth;
            mpGrowth = initialStats.MPGrowth;
            atkGrowth = initialStats.ATKGrowth;
            defGrowth = initialStats.DEFGrowth;
            mag_atkGrowth = initialStats.MAG_ATKGrowth;
            mag_defGrowth = initialStats.MAG_DEFGrowth;
            spdGrowth = initialStats.SPDGrowth;

            techniqueLevelData = initialStats.techniqueLevelData;
        }
Exemplo n.º 30
0
 public Line(string line, CharacterIdentity identity)
 {
     myLine     = line;
     myIdentity = identity;
 }
        public void LoadContent(int battleOrder, CharacterIdentity enemyID)
        {
            EnemyBattleCharacterData enemyData = GameClass.ContentManager.Load<EnemyBattleCharacterData>("BattleCharacters/" + enemyID.ToString() + "/" + enemyID.ToString() + "Battle");

               name = enemyData.name;
               runSpeed = enemyData.runSpeed;
               this.battleOrder = battleOrder;
               Sprites = new Dictionary<string, AnimatedSprite>();
               Sprites.Add("Idle", AnimatedSprite.CreateFromData(enemyData.idleAnimation));
               Sprites.Add("Run", AnimatedSprite.CreateFromData(enemyData.runAnimation));
               Sprites.Add("Damage", AnimatedSprite.CreateFromData(enemyData.damageAnimation));
               Sprites.Add("Death", AnimatedSprite.CreateFromData(enemyData.deathAnimation));
               Sprites["Death"].AnimationType = SpriteAnimationType.AnimateOnceMaintainLast;
               yDrawOffset = enemyData.drawOffset;

               switch (battleOrder)
               {
               case 3:
                   position = new Vector2(390, 275 - enemyData.drawOffset);
                   battlePortrait = GameClass.LoadTextureData("General/EnemyBattlePortrait1");
                   battlePortraitPosition = new Vector2(330, 338);
                   break;
               case 4:
                   position = new Vector2(440, 295 - enemyData.drawOffset);
                   battlePortrait = GameClass.LoadTextureData("General/EnemyBattlePortrait2");
                   battlePortraitPosition = new Vector2(330, 358);
                   break;
               case 5:
                   position = new Vector2(490, 315 - enemyData.drawOffset);
                   battlePortrait = GameClass.LoadTextureData("General/EnemyBattlePortrait3");
                   battlePortraitPosition = new Vector2(330, 378);
                   break;
               }

               CurrentAction = "Idle";
               CurrentSprite.CurrentFrame = GameClass.Random.Next(0, CurrentSprite.TotalFrames);

               Facing = CharacterFacing.Left;
               maxHP = enemyData.HP;
               currentHP = maxHP;
               displayHP = maxHP;
               maxMP = enemyData.MP;
               currentMP = maxMP;
               displayMP = maxMP;
               baseATK = enemyData.ATK;
               currentATK = baseATK;
               baseDEF = enemyData.DEF;
               currentDEF = baseDEF;
               baseMAG_ATK = enemyData.MAG_ATK;
               currentMAG_ATK= baseMAG_ATK;
               baseMAG_DEF = enemyData.MAG_DEF;
               currentMAG_DEF = baseMAG_DEF;
               baseSPD = enemyData.SPD;
               currentSPD = baseSPD;
               expWorth = enemyData.EXPWorth;

            techniques = new List<BattleTechnique>();
            foreach (BattleTechniqueData techData in enemyData.techniques)
            {
                BattleTechnique newTechnique = new BattleTechnique();
                newTechnique.LoadContent(this, techData);
                techniques.Add(newTechnique);
            }
        }