Exemplo n.º 1
0
 private void Add(CharacterName character, ServerDateStamped wurmDateTime)
 {
     lock (locker)
     {
         data.Add(new LiveLogsDataForCharacter(character, wurmDateTime, null));
     }
 }
Exemplo n.º 2
0
 private void Add(CharacterName character, ServerUptimeStamped uptime)
 {
     lock (locker)
     {
         data.Add(new LiveLogsDataForCharacter(character, null, uptime));
     }
 }
        public void UpdateHandRotationAndPosition(CharacterName characterName)
        {
            GameObject o = GameObject.FindGameObjectWithTag(hand.ToString());

            o.transform.position = handCorrectPositions[_handPositionIndexes[characterName]].position;
            o.transform.rotation = handCorrectPositions[_handPositionIndexes[characterName]].rotation;
        }
Exemplo n.º 4
0
 WurmCharacter Create(CharacterName name)
 {
     if (characterDirectories.Exists(name))
     {
         var character = new WurmCharacter(
             name,
             characterDirectories.GetFullDirPathForCharacter(name),
             wurmConfigs,
             wurmServers,
             wurmServerHistory,
             logger,
             taskManager,
             wurmLogsMonitor,
             publicEventInvoker,
             internalEventAggregator,
             wurmLogsHistory,
             wurmPaths,
             serverGroups
             );
         allCharacters.Add(name, character);
         return(character);
     }
     else
     {
         throw new DataNotFoundException($"Directory for character {name} does not exist.");
     }
 }
Exemplo n.º 5
0
 void Start()
 {
     characterName = characterSheet.GetComponent <CharacterInfoDisplayBehaviour>().CharaName; //retrives the specfic character name
     character     = CharacterManager.GetCharacterByName(characterName);                      //retrieves everything attached to that specific character
     statuses      = character.Statuses();
     EventBus.ClientInstance.Subscribe(EventConstants.StatusStacksUpdated, OnStackUpdated);
 }
Exemplo n.º 6
0
    private int GetHPCharacter(CharacterName name)
    {
        int hp;

        switch (name)
        {
        case CharacterName.ApacheKid:
        case CharacterName.DonBell:
        case CharacterName.ElenaFuente:
        case CharacterName.ElGringo:
        case CharacterName.PaulRegret:
        case CharacterName.PixiePete:
        case CharacterName.SeanMallory:
        case CharacterName.TerenKill:
            hp = 3;
            break;

        case CharacterName.GaryLooter:
        case CharacterName.TucoFranziskaner:
            hp = 5;
            break;

        case CharacterName.BigSpencer:
            hp = 9;
            break;

        default:
            hp = 4;
            break;
        }
        return(hp);
    }
Exemplo n.º 7
0
 public Conversation(CharacterName character, string conversationText, ConversationType conversationType)
 {
     this.Character        = character;
     this.ConversationText = conversationText;
     this.ConversationType = conversationType;
     nextConversation      = new Conversation[0];
 }
 /// <summary>
 /// Enemy 3 Options
 /// </summary>
 public void Enemy3()
 {
     enemyHUD.SetActive(false);
     actualCharacterName = CharacterName.Enemy3;
     ChangeAnimation(Animations.MoveIn);
     destination = enemyPosition[2].transform.position;
 }
Exemplo n.º 9
0
    /// <summary>
    /// Finds the default corresponding item per carracter
    /// </summary>
    /// <param name="characterName">The character to map a item to</param>
    /// <returns>The item mapped by default</returns>
    public static PoolItem DefaultThrowable(CharacterName characterName)
    {
        switch (characterName)
        {
        case CharacterName.Sebas:
            return(PoolItem.Bottle);

        case CharacterName.Camacho:
            return(PoolItem.BMW);

        case CharacterName.Chavarria:
            return(PoolItem.Car);

        case CharacterName.Ramon:
            return(PoolItem.PlayController);

        case CharacterName.Joaquin:
            return(PoolItem.Anime);

        case CharacterName.Maritza:
            return(PoolItem.Cat);

        case CharacterName.Majo:
            return(PoolItem.Leaf);

        case CharacterName.Lucia:
            return(PoolItem.Tulip);
        }
        return(PoolItem.Bottle);
    }
Exemplo n.º 10
0
    private void CreateIdInfo()
    {
        CharacterName characterName = CNG.instance.gen.GenerateNameObject(Gender.Other);

        aiName    = characterName.GetFirstName();
        aiSurname = characterName.GetSurname();
        aiGender  = characterName.GetGenderString();
        if (aiGender.Equals("Female"))
        {
            do
            {
                spriteNumber = Random.Range(1, 6).ToString("D2");
            } while (spriteNumber.Equals(manager.GetGameData().lastFemaleSpriteNumber));

            manager.GetGameData().lastFemaleSpriteNumber = spriteNumber;
        }
        else
        {
            do
            {
                spriteNumber = Random.Range(1, 6).ToString("D2");
            } while (spriteNumber.Equals(manager.GetGameData().lastMaleSpriteNumber));

            manager.GetGameData().lastMaleSpriteNumber = spriteNumber;
        }
    }
        /// <summary>
        /// </summary>
        /// <param name="sender">
        /// </param>
        /// <param name="message">
        /// </param>
        public void Handle(object sender, Message message)
        {
            var client = (Client)sender;
            var createCharacterMessage = (CreateCharacterMessage)message.Body;

            var characterName = new CharacterName
            {
                AccountName  = client.AccountName,
                Name         = createCharacterMessage.Name,
                Breed        = (int)createCharacterMessage.Breed,
                Gender       = (int)createCharacterMessage.Gender,
                Profession   = (int)createCharacterMessage.Profession,
                Level        = createCharacterMessage.Level,
                HeadMesh     = createCharacterMessage.HeadMesh,
                MonsterScale = createCharacterMessage.MonsterScale,
                Fatness      = (int)createCharacterMessage.Fatness
            };
            int characterId = characterName.CheckAgainstDatabase();

            if (characterId < 1)
            {
                client.Send(0x0000FFFF, new NameInUseMessage());
                return;
            }

            characterName.SendNameToStartPlayfield(
                createCharacterMessage.StarterArea == StarterArea.Shadowlands,
                characterId);
            client.Send(0x0000FFFF, new CharacterCreatedMessage {
                CharacterId = characterId
            });
        }
Exemplo n.º 12
0
 public void Attack(string id, CharacterName name, Character opponent)
 {
     int demage = 0;
     switch (name)
     {
         case CharacterName.EHonda:
             Console.WriteLine(id + ": Thut Hai!");
             demage = 480;
             break;
         case CharacterName.Blanka:
             Console.WriteLine(id + ": WRAR!");
             demage = 450;
             break;
         case CharacterName.Balrog:
             Console.WriteLine(id + ": Oh Wahg!");
             demage = 530;
             break;
         case CharacterName.Sagat:
             Console.WriteLine(id + ": Taiger Knee!");
             demage = 550;
             break;
         case CharacterName.Vega:
             Console.WriteLine(id + ": Piew Woo!");
             demage = 580;
             break;
         case CharacterName.MBison:
             Console.WriteLine(id + ": Psycho Crusher!");
             demage = 640;
             break;
         default:
             Console.WriteLine(id + ": I can not perfrom this technique.");
             break;
     }
     opponent.Gethit(demage);
 }
Exemplo n.º 13
0
        public override void Deserialize(System.IO.BinaryReader r)
        {
            int Version = r.ReadInt32();

            if (Version > CURRENT_VERSION)
            {
                Debug.LogError("version error");
                return;
            }

            byte[] data = PETools.Serialize.ReadBytes(r);
            if (data != null)
            {
                mCharacterName = new CharacterName();
                mCharacterName.Import(data);
            }

            mFaceIcon     = PETools.Serialize.ReadNullableString(r);
            mFaceIconBig  = PETools.Serialize.ReadNullableString(r);
            mShopIcon     = PETools.Serialize.ReadNullableString(r);
            mMissionState = (NpcMissionState)r.ReadInt32();
            mMapIcon      = r.ReadInt32();

            Invoke("RefreshState", 2f);
        }
Exemplo n.º 14
0
    public CharacterName[] GenerateNames(int namesNeeded)
    {
        CharacterName[] names = new CharacterName[namesNeeded];

        //TODO - filling this with empty names so the rest of our code is safe to run without need for many null checks



        for (int i = 0; i < names.Length; i++)
        {
            int randomFirstNameNumber      = Random.Range(0, firstNames.Count);
            int randomLastNameNumber       = Random.Range(0, lastNames.Count);
            int randomDescriptorNameNumber = Random.Range(0, descriptors.Count);
            int randomNickNameNumber       = Random.Range(0, nicknames.Count);

            CharacterName BigDawg = new CharacterName(firstNames[randomFirstNameNumber], lastNames[randomLastNameNumber], nicknames[randomNickNameNumber], descriptors[randomDescriptorNameNumber]);


            names[i] = BigDawg;
        }

        //Debug.LogWarning("CharacterNameGenerator called, it needs to fill out the names array with unique randomly constructed character names");

        return(names);
    }
Exemplo n.º 15
0
            public void GetLogFilesForNewCharacter()
            {
                var newCharacterName = new CharacterName("Figurant");

                Expect(subscriber.ReceivedMessages.Count(m => m.CharacterName == newCharacterName), EqualTo(0));

                CreateNewCharacterDirWithALog("Figurant", "_Event.2012-07.txt");

                IWurmCharacterLogFiles manager = null;

                WaitUntilTrue(() =>
                {
                    try
                    {
                        manager = System.GetForCharacter(newCharacterName);
                        return(true);
                    }
                    catch (Exception exception)
                    {
                        Trace.WriteLine(exception.Message);
                        return(false);
                    }
                });

                subscriber.WaitMessages(1, m => m.CharacterName == newCharacterName);
                var results = manager.GetLogFiles(DateTime.MinValue, DateTime.MaxValue, LogType.Event);

                Expect(results.Count(), EqualTo(1));
            }
    public override void OnLobbyServerSceneLoadedForPlayer(NetworkManager manager, GameObject lobbyPlayer, GameObject gamePlayer)
    {
        LobbyPlayer   lobby     = lobbyPlayer.GetComponent <LobbyPlayer>();
        CharacterName character = gamePlayer.GetComponent <CharacterName>();

        character.dinoName = lobby.playerName;
    }
Exemplo n.º 17
0
        /// <summary>
        /// 加载角色
        /// </summary>
        /// <param name="name"></param>
        public GameObject GetCharacterPrefab(CharacterName name)
        {
            GameObject _character;

            _character = Tools.Tools.LoadPrefab <GameObject>("Prefab/Character/Tank");
            return(_character);
        }
Exemplo n.º 18
0
    IEnumerator StartGame()
    {
        //Set towers evolution
        foreach (var tower in FindObjectsOfType <TowerController>())
        {
            tower.SetLastEvolution(currentSettings.towersMaxEvolution);
        }
        //Set Timer
        levelTimer.SetTimerLimit(currentSettings.levelMaxTime);
        hudManager.UpdateCountdown(levelTimer.GetTimer());

        //yield return StartCoroutine(hudManager.FadeHud(0));
        hudManager.HideHUD();

        //Check if tutorial is already played else start it
        if (!PlayerPrefs.HasKey("INTRO"))
        {
            PlayerPrefs.SetString("INTRO", "true");
            yield return(StartCoroutine(tutorialManager.PlayTutorial()));
        }

        hudManager.StartCountdown();
        yield return(new WaitForSeconds(5.2f));

        hudManager.ShowHUD();
        yield return(StartCoroutine(hudManager.FadeHud(1)));


        CharacterName character = (CharacterName)Enum.Parse(typeof(CharacterName), PlayerPrefs.GetString("CHARACTER", CharacterName.Character1.ToString()));

        playerSpawner.InitPlayer(character);
        levelTimer.ResetTimer();
        gameStarted = true;
    }
Exemplo n.º 19
0
    public CharacterName[] GenerateNames(int namesNeeded)
    {
        CharacterName[] names = new CharacterName[namesNeeded];

        // access the first firstName
        Debug.Log(firstNames[0]);

        //TODO - filling this with empty names so the rest of our code is safe to run without need for many null checks
        //CharacterName emptyName = new CharacterName(string.Empty, string.Empty, string.Empty, string.Empty);
        for (int i = 0; i < names.Length; i++)
        {
            // TODO for week 7 - Do this 4th
            // - Make use of the firstNames, lastNames, nicknames and
            // - descriptors lists

            CharacterName totalName = new CharacterName
                                          (firstNames[Random.Range(0, firstNames.Count)],
                                          lastNames[Random.Range(0, lastNames.Count)],
                                          nicknames[Random.Range(0, nicknames.Count)],
                                          descriptors[Random.Range(0, descriptors.Count)]);

            names[i] = totalName;
        }

        Debug.LogWarning("CharacterNameGenerator called, it needs to fill out the names array with unique randomly constructed character names");

        return(names);
    }
    public static Character createRandomCharacter()
    {
        /**
         * We want to setup these values in a very particular sequence.
         * i.e. What is said in life events depends on age.
         * i.e. A character's name depends on their gender.
         * etc. etc.
         */

        Age                   age                   = Age.ReturnRandomAge();
        Mother                mother                = Mother.ReturnMother();
        Father                father                = Father.ReturnFather();
        Parents               parents               = Parents.ReturnRandomParentsComment();
        Appearance            appearance            = Appearance.ReturnRandomAppearanceComment();
        Race                  race                  = Race.ReturnRandomRace();
        LifeEvents            lifeEvents            = LifeEvents.ReturnRandomLifeEventsComment();
        Childhood             childhood             = Childhood.ReturnRandomChildhoodEvent();
        Adolescence           adolescence           = Adolescence.ReturnRandomAdolescenceEvent();
        Adulthood             adulthood             = Adulthood.ReturnRandomAdulthoodEvent();
        OldAge                elder                 = OldAge.ReturnRandomElderlyEvent();
        Profession            profession            = Profession.ReturnRandomProfession();
        RelationshipStatus    relationshipStatus    = RelationshipStatus.ReturnRandomRelationshipStatus();
        Stats                 stats                 = Stats.GenerateRandomStats();
        Role                  role                  = Role.ReturnRandomRole();
        Demeanor              demeanor              = Demeanor.ReturnRandomDemeanor();
        Gender                gender                = Gender.ReturnRandomGender();
        CharacterName         characterName         = CharacterName.ReturnRandomCharacterName(gender);
        PlaceOfResidence      placeOfResidence      = PlaceOfResidence.ReturnRandomPlaceOfResidence();
        NullChatMenuComponent nullChatMenuComponent = new NullChatMenuComponent("");

        Character randomCharacter;

        randomCharacter = new Character(characterName, age, parents, mother, father, appearance, race, lifeEvents, childhood, adolescence, adulthood, elder, profession, relationshipStatus, stats, role, demeanor, gender, placeOfResidence, nullChatMenuComponent);
        return(randomCharacter);
    }
Exemplo n.º 21
0
 private void Add(CharacterName character, ServerDateStamped wurmDateTime)
 {
     lock (locker)
     {
         data.Add(new LiveLogsDataForCharacter(character, wurmDateTime, null));
     }
 }
Exemplo n.º 22
0
        public LogsMonitorEngineManager(
            [NotNull] CharacterName characterName,
            [NotNull] CharacterLogsMonitorEngineFactory characterLogsMonitorEngineFactory,
            [NotNull] IPublicEventInvoker publicEventInvoker,
            [NotNull] IWurmApiLogger logger,
            [NotNull] IInternalEventInvoker internalEventInvoker)
        {
            if (characterName == null)
            {
                throw new ArgumentNullException(nameof(characterName));
            }
            if (characterLogsMonitorEngineFactory == null)
            {
                throw new ArgumentNullException(nameof(characterLogsMonitorEngineFactory));
            }
            if (publicEventInvoker == null)
            {
                throw new ArgumentNullException(nameof(publicEventInvoker));
            }
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }
            if (internalEventInvoker == null)
            {
                throw new ArgumentNullException(nameof(internalEventInvoker));
            }
            this.characterName        = characterName;
            this.publicEventInvoker   = publicEventInvoker;
            this.logger               = logger;
            this.internalEventInvoker = internalEventInvoker;

            engine = characterLogsMonitorEngineFactory.Create(characterName);
        }
Exemplo n.º 23
0
 public void Attack(string id, CharacterName name, Character opponent)
 {
     int demage = 0;
     switch (name)
     {
         case CharacterName.Ryu:
             Console.WriteLine(id + ": Tatsumaki Senpukyaku!");
             demage = 360;
             break;
         case CharacterName.Ken:
             Console.WriteLine(id + ": Tatsumaki Senpukyaku!");
             demage = 360;
             break;
         case CharacterName.ChunLi:
             Console.WriteLine(id + ": SpinningBirdKick!");
             demage = 480;
             break;
         case CharacterName.Zangief:
             Console.WriteLine(id + ": Orhyeah!");
             demage = 430;
             break;
         default:
             Console.WriteLine(id + ": I can not perfrom this technique.");
             break;
     }
     opponent.Gethit(demage);
 }
Exemplo n.º 24
0
 public ICamp(CharacterName soldierType, float trainTime)
 {
     mBotanyType = soldierType;
     mTrainTime  = trainTime;
     mTrainTimer = mTrainTime;
     mCommands   = new List <ITrainCommand>();
 }
Exemplo n.º 25
0
        /// <summary>
        /// Loads the associated assets from the defined sources and prevents further authoring of the asset
        /// </summary>
        public void LoadAssociatedAssets()
        {
            var charName = CharacterName.ToString();

            EmotionalAppraisalAsset ea = Loader(m_emotionalAppraisalAssetSource, () => new EmotionalAppraisalAsset());

            EmotionalDecisionMakingAsset edm = Loader(m_emotionalDecisionMakingAssetSource, () => new EmotionalDecisionMakingAsset());
            SocialImportanceAsset        si  = Loader(m_socialImportanceAssetSource, () => new SocialImportanceAsset());
            CommeillFautAsset            cfa = Loader(m_commeillFautAssetSource, () => new CommeillFautAsset());

            m_emotionalAppraisalAsset      = ea;
            m_emotionalDecisionMakingAsset = edm;
            m_socialImportanceAsset        = si;
            m_commeillFautAsset            = cfa;

            MCTSAsset mcts = new MCTSAsset();

            //Dynamic properties
            BindToRegistry(m_kb);
            edm.RegisterKnowledgeBase(m_kb);
            si.RegisterKnowledgeBase(m_kb);
            cfa.RegisterKnowledgeBase(m_kb);
            mcts.RegisterKnowledgeBase(m_kb);
            m_allowAuthoring = false;
        }
Exemplo n.º 26
0
 private void Add(CharacterName character, ServerUptimeStamped uptime)
 {
     lock (locker)
     {
         data.Add(new LiveLogsDataForCharacter(character, null, uptime));
     }
 }
Exemplo n.º 27
0
        public ServerHistoryProvider(
            CharacterName characterName, IPersistent<PersistentModel.ServerHistory> persistentData,
            IWurmLogsMonitorInternal logsMonitor,
            IWurmLogsHistory logsSearcher,
            IWurmServerList wurmServerList,
            ILogger logger,
            IWurmCharacterLogFiles wurmCharacterLogFiles)
        {
            if (characterName == null) throw new ArgumentNullException("characterName");
            if (persistentData == null) throw new ArgumentNullException("persistentData");
            if (logsMonitor == null) throw new ArgumentNullException("logsMonitor");
            if (logsSearcher == null) throw new ArgumentNullException("logsSearcher");
            if (wurmServerList == null) throw new ArgumentNullException("wurmServerList");
            if (logger == null) throw new ArgumentNullException("logger");
            if (wurmCharacterLogFiles == null) throw new ArgumentNullException("wurmCharacterLogFiles");
            this.characterName = characterName;
            this.sortedServerHistory = new SortedServerHistory(persistentData);
            this.persistentData = persistentData;
            this.logsMonitor = logsMonitor;
            this.logsSearcher = logsSearcher;
            this.wurmServerList = wurmServerList;
            this.logger = logger;
            this.wurmCharacterLogFiles = wurmCharacterLogFiles;

            logsMonitor.SubscribeInternal(characterName, LogType.Event, HandleEventLogEntries);
        }
Exemplo n.º 28
0
    public static string PrimeiroNome(this CharacterName characterName)
    {
        switch (characterName)
        {
        case CharacterName.Jean:
            return("Jean");

        case CharacterName.Vladmir:
            return("Vladmir");

        case CharacterName.Paulino:
            return("Paulino");

        case CharacterName.Celestino:
            return("Celestino");

        case CharacterName.Montanari:
            return("Maria");

        case CharacterName.Antonia:
            return("Antônia");

        case CharacterName.Alice:
            return("Alice");

        case CharacterName.Diretor:
            return("João");

        default:
            return("");
        }
    }
Exemplo n.º 29
0
    public static string NomeCompleto(this CharacterName characterName)
    {
        switch (characterName)
        {
        case CharacterName.Jean:
            return("Jean Pires Filho");

        case CharacterName.Vladmir:
            return("Vladmir Mikovitch");

        case CharacterName.Paulino:
            return("Paulino do Rego Freitas");

        case CharacterName.Celestino:
            return("Celestino");

        case CharacterName.Montanari:
            return("Maria Montanari");

        case CharacterName.Antonia:
            return("Antônia");

        case CharacterName.Alice:
            return("Alice Menezes");

        case CharacterName.Diretor:
            return("João Frederico");

        default:
            return("");
        }
    }
Exemplo n.º 30
0
    public CharacterName[] GenerateNames(int namesNeeded)
    {
        CharacterName[] names = new CharacterName[namesNeeded];

        // access the first firstName
        //Debug.Log(firstNames[0]);

        //TODO - filling this with empty names so the rest of our code is safe to run without need for many null checks
        for (int i = 0; i < names.Length; i++)
        {
            // - Make use of the firstNames, lastNames, nicknames and
            // - descriptors lists
            int           namesF       = Random.Range(0, firstNames.Count);
            int           namesL       = Random.Range(0, lastNames.Count);
            int           nickN        = Random.Range(0, nicknames.Count);
            int           des          = Random.Range(0, descriptors.Count);
            CharacterName currentNames = new CharacterName(
                firstNames[namesF], lastNames[namesL],
                nicknames[nickN], descriptors[des]);
            names[i] = currentNames;
        }

        Debug.LogWarning("CharacterNameGenerator called, it needs to fill out the names array with unique randomly constructed character names");

        return(names);
    }
Exemplo n.º 31
0
    public static Sprite SpriteSW(CharacterName character)
    {
        var list    = Instance.characterNameAndItsSprites;
        var element = list.Find(x => x.Character == character);

        return(element.SpriteSW);
    }
Exemplo n.º 32
0
 public string GetFullDirPathForCharacter([NotNull] CharacterName characterName)
 {
     if (characterName == null)
     {
         throw new ArgumentNullException(nameof(characterName));
     }
     return(GetFullPathForDirName(characterName.Normalized));
 }
Exemplo n.º 33
0
 public LiveLogsDataForCharacter(CharacterName character, [CanBeNull] ServerDateStamped wurmDateTime, 
     [CanBeNull] ServerUptimeStamped uptime)
 {
     if (character == null) throw new ArgumentNullException("character");
     this.character = character;
     WurmDateTime = wurmDateTime;
     Uptime = uptime;
 }
Exemplo n.º 34
0
        public void SubscribeInternal(CharacterName characterName, LogType logType,
                                      EventHandler <LogsMonitorEventArgs> eventHandler)
        {
            Rebuild();
            var manager = GetManager(characterName);

            manager.AddSubscriptionInternal(logType, eventHandler);
        }
Exemplo n.º 35
0
 private void setAnimation(CharacterAnimationState charAnimState, CharacterName character)
 {
     Actor actor = actors[character];
     String ch = "Characters/" + character.ToString().ToLower() + "/man/" + charAnimState + ".TVA";
     actor.Actor.ImportAnimations("Characters/" + character.ToString().ToLower() + "/man/" + charAnimState + ".TVA");
     actor.Actor.SetAnimationByName(charAnimState.ToString());
     actor.Actor.PlayAnimation(1);
     actor.CharacterAnimState = charAnimState;
 }
 public static void SetAnimatorPropSpeed(CharacterName characterName, float value) {
     switch (characterName) {
         case CharacterName.Aoi:
             aoiAnimator.SetFloat(PROP_SPEED, value);
             break;
         case CharacterName.Akai:
             akaiAnimator.SetFloat(PROP_SPEED, value);
             break;
         case CharacterName.Ki:
             kiAnimator.SetFloat(PROP_SPEED, value);
             break;
     }
 }
 public static void SetAnimatorPropIdleNr(CharacterName characterName, int value) {
     switch (characterName) {
         case CharacterName.Aoi:
             aoiAnimator.SetInteger(PROP_IDLE_NR, value);
             break;
         case CharacterName.Akai:
             akaiAnimator.SetInteger(PROP_IDLE_NR, value);
             break;
         case CharacterName.Ki:
             kiAnimator.SetInteger(PROP_IDLE_NR, value);
             break;
     }
 }
 public void Spawn(CharacterName characterToSpawn)
 {
     startX = transform.rotation.eulerAngles.x;
     startZ = transform.rotation.eulerAngles.z;
     //spawn logic
     hasSpawned = true;
     //Debug.Log("Spawning: " + characterToSpawn);
     var gameObject =(GameObject) Instantiate(Resources.Load(characterPath + characterToSpawn), transform.position, transform.rotation);
     if (LookAtGameObect)
     {
         gameObject.transform.parent = transform;
     }
 }
 /// <summary>
 /// Almacena referencia al componente Animator del personaje especificado
 /// </summary>
 /// <param name="characterName">Nombre del personaje</param>
 /// <param name="animator">Componente Animator</param>
 public static void SetAnimatorReference(CharacterName characterName, Animator animator) {
     switch (characterName) {
         case CharacterName.Aoi:
             aoiAnimator = animator;
             break;
         case CharacterName.Akai:
             akaiAnimator = animator;
             break;
         case CharacterName.Ki:
             kiAnimator = animator;
             break;
     }
 }
 public ServerHistoryProvider Create(CharacterName characterName)
 {
     if (characterName == null) throw new ArgumentNullException("characterName");
     var persistent = persistentCollection.GetObject<PersistentModel.ServerHistory>(characterName.Normalized);
     var wurmCharacterLogFiles = wurmLogFiles.GetForCharacter(characterName);
     return new ServerHistoryProvider(
         characterName,
         persistent,
         wurmLogsMonitor,
         wurmLogsHistory,
         wurmServerList,
         logger,
         wurmCharacterLogFiles);
 }
    public void displayNPC(CharacterName name)
    {
        //Debug.Log( (int)name );
        if( matArray[(int)name] != null)
        {

            startTimer = true;
            gameObject.renderer.enabled = true;
            gameObject.renderer.material = matArray[(int)name];
            //mDisplayPlaneOne.renderer.material = matArray[(int)name];
            displayFace = true;

            //mDisplayPlaneOne.renderer.material.color = new Color(1,1,1,1);
        }
    }
Exemplo n.º 42
0
        public Creature createCreature(CharacterName type, Statistics statistics)
        {
            String uniqueName = type.ToString() + id;

            Creature creature = new Creature(container.getObject<Game>("mainGame"));
            creature.UniqueName = uniqueName;
            creature.Statistics = statistics;
            creature.CreatureService = this;
            creature.CharacterName = type;
            creature.AnimationService = container.getObject<AnimationService>("animationService");

            container.addComponent(creature, uniqueName);
            creatures.Add(uniqueName, creature);
            id++;
            return creature;
        }
Exemplo n.º 43
0
        public virtual CharacterMonthlyLogHeuristics GetForCharacter(CharacterName characterName)
        {
            if (characterName == null) throw new ArgumentNullException("characterName");

            CharacterMonthlyLogHeuristics heuristics;
            if (!cache.TryGetValue(characterName, out heuristics))
            {
                IPersistent<WurmCharacterLogsEntity> persistentData =
                    heuristicsPersistentCollection.GetObject<WurmCharacterLogsEntity>(characterName.Normalized);
                heuristics = new CharacterMonthlyLogHeuristics(
                    persistentData,
                    monthlyHeuristicsExtractorFactory,
                    wurmLogFiles.GetForCharacter(characterName));
                cache.Add(characterName, heuristics);
            }
            return heuristics;
        }
Exemplo n.º 44
0
        public LogsMonitorEventArgs(CharacterName characterName, LogType logType, IEnumerable<LogEntry> wurmLogEntries, string conversationNameNormalized = null)
        {
            if (characterName == null)
            {
                throw new ArgumentNullException("characterName");
            }
            if (wurmLogEntries == null)
            {
                throw new ArgumentNullException("wurmLogEntries");
            }
            if (conversationNameNormalized == null) conversationNameNormalized = string.Empty;

            this.CharacterName = characterName;
            this.LogType = logType;
            this.WurmLogEntries = wurmLogEntries;
            this.ConversationNameNormalized = conversationNameNormalized;
        }
Exemplo n.º 45
0
 public void changeAnimation(CharacterAnimationState charAnimState, CharacterName character)
 {
     int i = 0;
     bool found = false;
     string[] animNames = Enum.GetNames(typeof(CharacterAnimationState));
     while (i < animNames.Length && !found)
     {
         CharacterAnimationState value = (CharacterAnimationState)Enum.Parse(typeof(CharacterAnimationState), animNames[i]);
         if (charAnimState == value && actors[character].CharacterAnimState != value)
         {
             bool animLoop = !(charAnimState == CharacterAnimationState.Die || charAnimState == CharacterAnimationState.Die1 || charAnimState == CharacterAnimationState.Die2);
             setAnimationLoop(animLoop, character);
             setAnimation(value, character);
             found = true;
         }
         i++;
     }
 }
Exemplo n.º 46
0
        public LogsMonitorEngineManager(
            [NotNull] CharacterName characterName,
            [NotNull] CharacterLogsMonitorEngineFactory characterLogsMonitorEngineFactory,
            [NotNull] IPublicEventInvoker publicEventInvoker, 
            [NotNull] ILogger logger,
            [NotNull] IInternalEventInvoker internalEventInvoker)
        {
            if (characterName == null) throw new ArgumentNullException("characterName");
            if (characterLogsMonitorEngineFactory == null) throw new ArgumentNullException("characterLogsMonitorEngineFactory");
            if (publicEventInvoker == null) throw new ArgumentNullException("publicEventInvoker");
            if (logger == null) throw new ArgumentNullException("logger");
            if (internalEventInvoker == null) throw new ArgumentNullException("internalEventInvoker");
            this.characterName = characterName;
            this.characterLogsMonitorEngineFactory = characterLogsMonitorEngineFactory;
            this.publicEventInvoker = publicEventInvoker;
            this.logger = logger;
            this.internalEventInvoker = internalEventInvoker;

            engine = characterLogsMonitorEngineFactory.Create(characterName);
        }
Exemplo n.º 47
0
 public void registerActor(CharacterName name, Actor actor)
 {
     actors.Add(name, actor);
 }
Exemplo n.º 48
0
 private void setAnimationLoop(bool loop, CharacterName character)
 {
     Actor actor = actors[character];
     actor.Actor.SetAnimationLoop(loop);
 }
Exemplo n.º 49
0
 public void SetCharacterByName(CharacterName name)
 {
     Character character = characters.Find( x => x.name == name);
     SetCharacterByIndex(character.ID);
 }
Exemplo n.º 50
0
 WurmCharacter Create(CharacterName name)
 {
     if (characterDirectories.Exists(name))
     {
         var character = new WurmCharacter(
             name,
             characterDirectories.GetFullDirPathForCharacter(name),
             wurmConfigs,
             wurmServers,
             wurmServerHistory,
             logger,
             taskManager
             );
         allCharacters.Add(name, character);
         return character;
     }
     else
     {
         throw new DataNotFoundException(string.Format("Directory for character {0} does not exist.", name));
     }
 }
Exemplo n.º 51
0
 public async Task<ServerName> GetServerAsync(CharacterName character, DateTime exactDate, CancellationToken cancellationToken)
 {
     cancellationToken.ThrowIfCancellationRequested();
     return await runner.Run(new GetServerAtDateJob(character, exactDate), cancellationToken).ConfigureAwait(false);
 }
Exemplo n.º 52
0
 public ServerName GetServer(CharacterName character, DateTime exactDate)
 {
     return TaskHelper.UnwrapSingularAggegateException(() => GetServerAsync(character, exactDate).Result);
 }
Exemplo n.º 53
0
 public async Task<ServerName> GetCurrentServerAsync(CharacterName character)
 {
     return await GetCurrentServerAsync(character, CancellationToken.None).ConfigureAwait(false);
 }
Exemplo n.º 54
0
 public ServerName GetCurrentServer(CharacterName character, CancellationToken cancellationToken)
 {
     return TaskHelper.UnwrapSingularAggegateException(() => GetCurrentServerAsync(character, cancellationToken).Result);
 }
 public CharacterLogsMonitorEngine Create(CharacterName characterName)
 {
     return new CharacterLogsMonitorEngine(characterName, logger, singleFileMonitorFactory, wurmCharacterLogFiles,
         internalEventAggregator);
 }
Exemplo n.º 56
0
 public GetCurrentServerJob(CharacterName characterName)
 {
     CharacterName = characterName;
 }
Exemplo n.º 57
0
 public GetServerAtDateJob(CharacterName characterName, DateTime dateTime)
 {
     CharacterName = characterName;
     DateTime = dateTime;
 }
Exemplo n.º 58
0
 public async Task<ServerName> GetServerAsync(CharacterName character, DateTime exactDate)
 {
     return await GetServerAsync(character, exactDate, CancellationToken.None).ConfigureAwait(false);
 }
Exemplo n.º 59
0
 public async Task<ServerName> GetCurrentServerAsync(CharacterName character, CancellationToken cancellationToken)
 {
     cancellationToken.ThrowIfCancellationRequested();
     return await runner.Run(new GetCurrentServerJob(character), cancellationToken).ConfigureAwait(false);
 }
Exemplo n.º 60
0
 public IEnumerable<LogFileInfo> TryGetLogFilesForSpecificPm(DateTime dateFrom, DateTime dateTo, CharacterName pmCharacterName)
 {
     var allPmLogs = GetLogFiles(dateFrom, dateTo, LogType.Pm);
     return
         allPmLogs.Where(
             info => info.FileName.IndexOf(pmCharacterName.Normalized, StringComparison.InvariantCultureIgnoreCase) > -1);
 }