public void UpdateInstructionSize(bool isSelected, CharacterIndex charIndex){ //_instructionList[(int)charIndex].sprite = _instructionSpriteList[(int)instructionState]; if(isSelected){ IncreaseInstructionSize(charIndex); }else{ ResetInstructionSize(charIndex); } }
public CharacterIndex[] available_choices(CharacterIndex age) { List <CharacterIndex> r = new List <CharacterIndex>(); foreach (CharacterIndex e in age.get_neighbors()) { if (mManager.mMetaManager.UnlockManager.is_unlocked(e) == 1) { r.Add(e); } } return(r.ToArray()); }
public PerformanceStats(CharacterIndex aChar) { Stats = new CharacterStats(); Stats.Character = aChar; Finished = false; DeathTime = -1; //PerformanceGraph = new PerformanceGraphObject(11); mScore = new List <TimeScorePair>(); update_score(0, 0); //this is a dummy point }
public static void FF9Abil_SetEnableSA(CharacterIndex characterIndex, Int32 abil_id, Boolean enable) { UInt32[] numArray = FF9StateSystem.Common.FF9.player[characterIndex].sa; Int32 num = abil_id - 192; if (enable) { numArray[num >> 5] |= (UInt32)(1 << num); } else { numArray[num >> 5] &= (UInt32) ~(1 << num); } }
public void Create(int userId, string name, CharacterClasses characterClass, CharacterIndex characterIndex) { using (var db = databaseConnectionProvider.GetDbConnection()) { var user = new CharactersTableDefinition { UserId = userId, Name = name, CharacterType = characterClass.ToString(), CharacterIndex = (byte)characterIndex }; db.Insert(user); } }
//functions for AuthoringGuiBehaviour to call public void load_char_from_folder(CharacterIndex aChar, int aDiff) { var aFolder = "POSETEST/" + aChar.StringIdentifier + "_" + aDiff; //string[] dirs = System.IO.Directory.GetDirectories("POSETEST"); //string dir = System.IO.Directory.GetDirectories("POSETEST").FirstOrDefault(e => e == aFolder); //if(dir != null && dir != "") if (System.IO.Directory.Exists(aFolder)) { set_pose_animation(PoseAnimation.load_from_folder(aFolder), aDiff); } else { Gui.ErrorMessage = "ERROR: poses do not exist for " + aChar.StringIdentifier + " diff " + aDiff; } }
public CharacterLoader get_mini_character(CharacterIndex aIndex) { using (mMiniCharLock) return(mMiniCharacters[aIndex]); /* * if(mMiniCharacters[aIndex] == null) * { * CharacterTextureBehaviour ctb = (GameObject.Instantiate(mManager.mMenuReferences.miniMan) as GameObject).GetComponent<CharacterTextureBehaviour>(); * return new FlatBodyObject(ctb,aDepth); * GameObject.Destroy(ctb.gameObject); * } * else * return new FlatBodyObject(mMiniCharacters[aIndex],aDepth); */ }
public FlatUnlockIcon(CharacterIndex aChar, bool big, int aDepth) { var bgImage = ManagerManager.Manager.mCharacterBundleManager.get_image(big?"UNLOCKABLES_BOX_BIG" : "UNLOCKABLES_BOX_SMALL"); var charIcon = ManagerManager.Manager.mCharacterBundleManager.get_image("ICON_" + aChar.StringIdentifier); background = new FlatElementImage(bgImage.Image, bgImage.Data.Size, aDepth); icon = new FlatElementImage(charIcon.Image, charIcon.Data.Size, aDepth + 1); name = new FlatElementText(ManagerManager.Manager.mNewRef.genericFont, 50, FlatElementText.convert_to_multiline(1, aChar.ShortName.ToUpper()), aDepth + 1); mElements.Add(new FlatElementMultiBase.ElementOffset(background, new Vector3(0, 0, 0))); mElements.Add(new FlatElementMultiBase.ElementOffset(icon, new Vector3(0, 20, 0))); mElements.Add(new FlatElementMultiBase.ElementOffset(name, new Vector3(0, -200, 0))); PrimaryGameObject = create_primary_from_elements(); Depth = aDepth; }
public void write_poses_to_folder(CharacterIndex aChar, int aDiff) { if (mCurrentPoseAnimation != null && mCurrentPoseAnimation.poses.Count > 0) { var dirName = "POSETEST/" + aChar.StringIdentifier + "_" + aDiff; if (System.IO.Directory.Exists(dirName)) { System.IO.Directory.Delete(dirName, true); } System.IO.Directory.CreateDirectory(dirName); mCurrentPoseAnimation.save_to_folder(aChar.StringIdentifier + "_" + aDiff, "POSETEST/" + aChar.StringIdentifier + "_" + aDiff); } else { Gui.ErrorMessage = "ERROR: trying to save when there are no poses OR when poses are hidden."; } }
//TODO move to sunset //this gets called after choosing //this also gets called when you die/finish the game //also called when you get to age 110 public void transition_to_TRANSITION_play(CharacterIndex aNextCharacter) { float gDiffDisplayDur = 4f; GS = NormalPlayGameState.TRANSITION; //TODO maybe play a sound "Too Easy" "Ok" "Hard" "That's Impossible!!" var diffPhrases = new string[] { GameStrings.GetString("MNPdiff1"), GameStrings.GetString("MNPdiff2"), GameStrings.GetString("MNPdiff3"), GameStrings.GetString("MNPdiff4") }; TED.add_event( aNextCharacter.LevelIndex < 7 //if not grave or age 110 ? mSunsetManager.low_skippable_text_bubble_event(diffPhrases [NGM.CharacterHelper.Characters [aNextCharacter].Difficulty], gDiffDisplayDur) : delegate(float aTime){ return(true); } ).then_one_shot( delegate() { if (aNextCharacter != CharacterIndex.sGrave) { mManager.mAssetLoader.new_load_character(aNextCharacter.StringIdentifier, mManager.mCharacterBundleManager); } else { //This can probably stay here //we just died, so add the last character we just played and set the sun //normally this will get called right after you make a choice but if we're here that meeans we didn't make a choice because we died mSunsetManager.add_character(NGM.CurrentCharacterLoader.Character, !CurrentPerformanceStat.BadPerformance, false); mSunsetManager.set_sun(); slide_image(mFlatCamera, null, mSunsetImage, false, false); if (NGM.CurrentCharacterIndex == CharacterIndex.sOneHundred) { mSunsetManager.ShowBackground = false; } transition_to_GRAVE(); } } ); }
public CharacterIconObject(CharacterIndex aIndex, int aDepth) { //NOTE these assets were removed since this class is no longer being used. //mBackground = new FlatElementImage(ManagerManager.Manager.mNewRef.pbCharacterIconBackground,aDepth); //mDifficultyStars = new DifficultyObject(ManagerManager.Manager.mNewRef.uiPerfectStar,aDepth+1); mIcon = new FlatElementImage(null, aDepth + 3); if (aIndex.LevelIndex != -1) { var loaded = ManagerManager.Manager.mCharacterBundleManager.get_image("BOX_" + aIndex.StringIdentifier); mIcon.set_new_texture(loaded.Image, null); //loaded.Data.Size); } //TODO delete /* * if(aIcon == null) * { * CharacterTextureBehaviour ctb = (GameObject.Instantiate(ManagerManager.Manager.mReferences.mMiniChar) as GameObject).GetComponent<CharacterTextureBehaviour>(); * mBody = new FlatBodyObject(ctb,aDepth); * GameObject.Destroy(ctb.gameObject); * } * else * mBody = new FlatBodyObject(aIcon,aDepth+3); * mBody.HardShader = ManagerManager.Manager.mReferences.mMiniCharacterShader; */ //mBodyOffset = mDifficultyStars.mImageElements[0].BoundingBox.width/2 + 5; //float starOffset = mBackground.BoundingBox.width/2+5; //float starOffset = 0; mBodyOffset = 0; //mElements.Add(new ElementOffset(mDifficultyStars, new Vector3(-starOffset,-70,0))); mElements.Add(new ElementOffset(mBackground, new Vector3(mBodyOffset, 0, 0))); mElements.Add(new ElementOffset(mIcon, new Vector3(mBodyOffset, 20, 0))); //mElements.Add(new ElementOffset(mBody, new Vector3(mBodyOffset,0,0))); PrimaryGameObject = create_primary_from_elements(); Depth = aDepth; set_perfectness(0); }
public bool go_to_play() { mManager.mMusicManager.fade_out_extra_music(); //cheap hack var choices = mManager.mMetaManager.UnlockManager.get_unlocked_characters_at_level(1); CharacterIndex charIndex = Input.GetKeyDown(KeyCode.Alpha9) ? choices[Random.Range(0, choices.Count)] : CharacterIndex.sFetus; if (Input.GetKeyDown(KeyCode.Alpha9)) { GameConstants.numberRetries = 0; GameConstants.transitionToChoiceDelayTime = 0; GameConstants.preplayTime = 0; } mManager.mGameManager.start_game(charIndex); return(true); }
private static void FF9Play_UpdateSA(PLAYER play) { CharacterIndex characterIndex = play.Index; play.cur.capa = play.max.capa; for (Int32 index = 0; index < 64; ++index) { if (ff9abil.FF9Abil_GetEnableSA(characterIndex, 192 + index)) { if (play.cur.capa >= ff9abil._FF9Abil_SaData[index].GemsCount) { play.cur.capa -= ff9abil._FF9Abil_SaData[index].GemsCount; } else { ff9abil.FF9Abil_SetEnableSA(characterIndex, 192 + index, false); } } } }
public void announce_unlock(CharacterIndex aChar, UnlockRequirements.UnlockData aData) { float gDisplayTime = 5; FlatUnlockBadge badge = new FlatUnlockBadge(aChar, aData, 30); badge.HardPosition = mSunset.mFlatCamera.get_point(Vector3.zero) + new Vector3(0, 2000, 0); badge.SoftPosition = mSunset.mFlatCamera.get_point(Vector3.zero); mElement.Add(badge); TED.add_one_shot_event( delegate() { badge.SoftPosition = badge.SoftPosition + new Vector3(0, -2000, 0); } , gDisplayTime).then_one_shot( delegate(){ mElement.Remove(badge); badge.destroy(); } , 1.5f); }
public FlatUnlockBadge(CharacterIndex aChar, UnlockRequirements.UnlockData aData, int aDepth) { var unlockfont = ManagerManager.Manager.mNewRef.serifFont; var bgImage = ManagerManager.Manager.mCharacterBundleManager.get_image("UNLOCKABLES_PLATE"); background = new FlatElementImage(bgImage.Image, bgImage.Data.Size, aDepth); text1 = new FlatElementText(unlockfont, 120, "new lifestyle", aDepth + 1); text2 = new FlatElementText(unlockfont, 200, "UNLOCKED", aDepth + 1); mainIcon = new FlatUnlockIcon(aChar, true, aDepth + 1); if (aData.Related.Length == 0) { text3 = new FlatElementText(unlockfont, 200, FlatElementText.convert_to_multiline_max(35, aData.Sentence), aDepth + 1); } else { text3 = new FlatElementText(unlockfont, 70, FlatElementText.convert_to_multiline_max(35, aData.Sentence), aDepth + 1); } mElements.Add(new FlatElementMultiBase.ElementOffset(background, new Vector3(0, 0, 0))); mElements.Add(new FlatElementMultiBase.ElementOffset(text1, new Vector3(0, 600, 0))); mElements.Add(new FlatElementMultiBase.ElementOffset(text2, new Vector3(0, 450, 0))); mElements.Add(new FlatElementMultiBase.ElementOffset(mainIcon, new Vector3(0, 125, 0))); mElements.Add(new FlatElementMultiBase.ElementOffset(text3, new Vector3(0, -200, 0))); contributors = new FlatUnlockIcon[aData.Related.Length]; Vector3 step = new Vector3(-400, 0, 0); Vector3 start = (contributors.Length - 1) * (-step) / 2f + new Vector3(0, -700, 0); for (int i = 0; i < contributors.Length; i++) { contributors[i] = new FlatUnlockIcon(aData.Related[i], false, aDepth + 1); FlatUnlockIcon e = contributors[i]; mElements.Add(new FlatElementMultiBase.ElementOffset(e, start + step * i)); } PrimaryGameObject = create_primary_from_elements(); Depth = aDepth; }
public PoseAnimation get_pose(CharacterIndex aIndex, int aDiff) { PoseAnimation r = new PoseAnimation(); if (mPoses.ContainsKey(construct_pose_string(aIndex, aDiff, 1))) { for (int stage = 1; ; stage++) { string find = construct_pose_string(aIndex, aDiff, stage); if (mPoses.ContainsKey(find)) { r.poses.Add(mPoses[find]); } else { break; } } return(r); } /*else if(aIndex.Choice > 0) * { * Debug.Log ("grabbed fallback for " + construct_pose_string(aIndex,aDiff,1)); * CharacterIndex fallback = new CharacterIndex(aIndex.LevelIndex,aIndex.Choice-1); * return get_pose(fallback,aDiff); * }*/ else if (aIndex.LevelIndex > 1) { Debug.Log("grabbed fallback for " + construct_pose_string(aIndex, aDiff, 1)); CharacterIndex fallback = new CharacterIndex(aIndex.LevelIndex - 1, aIndex.Choice); return(get_pose(fallback, aDiff)); } else { r.poses.Add(mManager.mReferences.mCheapPose.to_pose()); return(r); } }
//returns amount of time this will take //TODO move all this stuff into ModeNormalPlay public TimedEventDistributor.TimedEventChain set_for_DEATH(CharacterIndex aChar) { //TODO switch to skippable bubbles here TY float gTextTime = 5; TimedEventDistributor.TimedEventChain chain = TED.empty_chain(); if (aChar.LevelIndex == 7) { } else if (aChar.LevelIndex == 8) { chain = TED.add_one_shot_event( delegate() { add_timed_text_bubble(GameStrings.GetString("NIM2"), gTextTime); }, 0).then_one_shot( //dummy delegate(){}, gTextTime); } else { chain = TED.add_one_shot_event( delegate() { add_timed_text_bubble(GameStrings.GetString("NIM3", aChar.Age.ToString()), gTextTime); }, 1).then_one_shot( delegate() { //TODO pink bar animations } , gTextTime).then_one_shot( //dummy delegate(){}, 0); } return(chain); }
public void start_game(CharacterIndex aChar) { //reset the scale in case we were in simian mode //GameConstants.SCALE = 1; if (mManager.mSimianMode) { Debug.Log("simian mode hehe"); GS = GameState.SIMIAN; mModeSimian.initialize(); } else if (GS != GameState.TEST) { GS = GameState.NORMAL; mModeNormalPlay.initialize_game_with_character(aChar); } else if (GS == GameState.TEST) { mManager.mAssetLoader.new_load_character(aChar.StringIdentifier, mManager.mCharacterBundleManager); } mManager.GameEventDistributor("START GAME", new object[] { GS }); }
public static CharacterId FF9Play_GetCharID2(CharacterIndex characterIndex, Boolean isSubCharacter) { Int32 index = characterIndex; if (index < CharacterIndex.Quina) // < 5 { return(index); } if (index == CharacterIndex.Beatrix) // == 8 { return(CharacterId.Beatrix); } if (index > CharacterIndex.Beatrix) // >> 8 { throw new NotSupportedException(characterIndex.ToString()); } // 5-7 return(isSubCharacter ? index + 3 // Sub characters : index); // Main characters }
void ResetInstructionSize(CharacterIndex charIndex){ _instructionList[(int)charIndex].gameObject.transform.localScale = new Vector3(2f, 2f, 2f); }
public CharacterStats get_character_stat(CharacterIndex aChar) { return(mCharacterHelper.Characters[aChar]); }
public void UpdateInstruction(InstructionState instructionState, CharacterIndex charIndex){ _instructionList[(int)charIndex].sprite = _instructionSpriteList[(int)instructionState]; }
void IncreaseInstructionSize(CharacterIndex charIndex){ _instructionList[(int)charIndex].gameObject.transform.localScale = new Vector3(2.5f, 2.5f, 2.5f); }