public static StudentEditorScript.StudentStats Deserialize(Dictionary <string, object> dict)
 {
     return(new StudentEditorScript.StudentStats
     {
         strength = TFUtils.LoadInt(dict, "Strength")
     });
 }
        public override void TFDescription(List <TooltipLine> tooltips)
        {
            Player player = Main.player[item.owner];

            AddTFAttribute(tooltips, TFColor[(int)TFColorID.AttributePositive], "Shows your chance of landing");
            AddTFAttribute(tooltips, TFColor[(int)TFColorID.AttributePositive], "a random critical hit");
            Color color      = Color.White;
            float multiplier = (player.GetModPlayer <TFModPlayer>().storedRandomCritChance - player.GetModPlayer <TFModPlayer>().randomCritMinMax[0]) / 10f;

            if (TFUtils.InRange(multiplier, 0f, 0.5f))
            {
                color = TFUtils.Gradient(new Color(255, 0, 0), new Color(255, 255, 0), multiplier * 2f);
            }
            if (TFUtils.InRange(multiplier, 0.5f, 1f))
            {
                color = TFUtils.Gradient(new Color(255, 255, 0), new Color(0, 255, 0), multiplier * 2f);
            }
            float  chance     = (float)Math.Floor(player.GetModPlayer <TFModPlayer>().storedRandomCritChance * 10f) / 10f;
            string chanceText = chance + "% " + (chance == player.GetModPlayer <TFModPlayer>().randomCritMinMax[1] ? "(MAX)" : "");

            if (item.buy)
            {
                chanceText = "(Purchase Electriocritiogram to show chance)";
                color      = new Color(255, 0, 0);
            }
            string text = "RCC: " + chanceText;

            AddTFAttribute(tooltips, color, text);
        }
 public static StudentJson[] LoadFromJson(string path)
 {
     StudentJson[] array = new StudentJson[101];
     for (int i = 0; i < array.Length; i++)
     {
         array[i] = new StudentJson();
     }
     foreach (Dictionary <string, object> dictionary in JsonData.Deserialize(path))
     {
         int num = TFUtils.LoadInt(dictionary, "ID");
         if (num == 0)
         {
             break;
         }
         StudentJson studentJson = array[num];
         studentJson.name       = TFUtils.LoadString(dictionary, "Name");
         studentJson.realname   = TFUtils.LoadString(dictionary, "RealName");
         studentJson.gender     = TFUtils.LoadInt(dictionary, "Gender");
         studentJson.classID    = TFUtils.LoadInt(dictionary, "Class");
         studentJson.seat       = TFUtils.LoadInt(dictionary, "Seat");
         studentJson.club       = (ClubType)TFUtils.LoadInt(dictionary, "Club");
         studentJson.persona    = (PersonaType)TFUtils.LoadInt(dictionary, "Persona");
         studentJson.crush      = TFUtils.LoadInt(dictionary, "Crush");
         studentJson.breastSize = TFUtils.LoadFloat(dictionary, "BreastSize");
         studentJson.strength   = TFUtils.LoadInt(dictionary, "Strength");
         studentJson.hairstyle  = TFUtils.LoadString(dictionary, "Hairstyle");
         studentJson.color      = TFUtils.LoadString(dictionary, "Color");
         studentJson.eyes       = TFUtils.LoadString(dictionary, "Eyes");
         studentJson.eyeType    = TFUtils.LoadString(dictionary, "EyeType");
         studentJson.stockings  = TFUtils.LoadString(dictionary, "Stockings");
         studentJson.accessory  = TFUtils.LoadString(dictionary, "Accessory");
         studentJson.info       = TFUtils.LoadString(dictionary, "Info");
         if (GameGlobals.LoveSick)
         {
             studentJson.name     = studentJson.realname;
             studentJson.realname = "";
         }
         if (OptionGlobals.HighPopulation && studentJson.name == "Unknown")
         {
             studentJson.name = "Random";
         }
         float[]  array3 = StudentJson.ConstructTempFloatArray(TFUtils.LoadString(dictionary, "ScheduleTime"));
         string[] array4 = StudentJson.ConstructTempStringArray(TFUtils.LoadString(dictionary, "ScheduleDestination"));
         string[] array5 = StudentJson.ConstructTempStringArray(TFUtils.LoadString(dictionary, "ScheduleAction"));
         studentJson.scheduleBlocks = new ScheduleBlock[array3.Length];
         for (int k = 0; k < studentJson.scheduleBlocks.Length; k++)
         {
             studentJson.scheduleBlocks[k] = new ScheduleBlock(array3[k], array4[k], array5[k]);
         }
         if (num == 10 || num == 11)
         {
             for (int l = 0; l < studentJson.scheduleBlocks.Length; l++)
             {
                 studentJson.scheduleBlocks[l] = null;
             }
         }
         studentJson.success = true;
     }
     return(array);
 }
示例#4
0
 // Token: 0x0600026A RID: 618 RVA: 0x00032424 File Offset: 0x00030824
 public static StudentEditorScript.StudentPersonality Deserialize(Dictionary <string, object> dict)
 {
     return(new StudentEditorScript.StudentPersonality {
         persona = (PersonaType)TFUtils.LoadInt(dict, "Persona"),
         crush = TFUtils.LoadInt(dict, "Crush")
     });
 }
示例#5
0
 // Token: 0x06000268 RID: 616 RVA: 0x000323D4 File Offset: 0x000307D4
 public static StudentEditorScript.StudentAttendanceInfo Deserialize(Dictionary <string, object> dict)
 {
     return(new StudentEditorScript.StudentAttendanceInfo {
         classNumber = TFUtils.LoadInt(dict, "Class"),
         seatNumber = TFUtils.LoadInt(dict, "Seat"),
         club = TFUtils.LoadInt(dict, "Club")
     });
 }
示例#6
0
 // Token: 0x0600026E RID: 622 RVA: 0x00032494 File Offset: 0x00030894
 public static StudentEditorScript.StudentCosmetics Deserialize(Dictionary <string, object> dict)
 {
     return(new StudentEditorScript.StudentCosmetics {
         breastSize = TFUtils.LoadFloat(dict, "BreastSize"),
         hairstyle = TFUtils.LoadString(dict, "Hairstyle"),
         color = TFUtils.LoadString(dict, "Color"),
         eyes = TFUtils.LoadString(dict, "Eyes"),
         stockings = TFUtils.LoadString(dict, "Stockings"),
         accessory = TFUtils.LoadString(dict, "Accessory")
     });
 }
示例#7
0
 public float[,] GetValue(string inputNode, string outputNode, byte[] inputData)
 {
     if (!_bModelLoaded)
         return null;
     var runner = _session.GetRunner();
     TFTensor tensor = TFUtils.CreateTensor(inputData, TFDataType.Float);
     runner.AddInput(_tfGraph[inputNode][0], tensor);
     runner.Fetch(_tfGraph[outputNode][0]);
     TFTensor[] output = runner.Run();
     float[,] value = (float[,])output[0].GetValue();
     return value;
 }
示例#8
0
    // Token: 0x06000571 RID: 1393 RVA: 0x0004B05C File Offset: 0x0004945C
    public static CreditJson[] LoadFromJson(string path)
    {
        List <CreditJson> list = new List <CreditJson>();

        foreach (Dictionary <string, object> dictionary in JsonData.Deserialize(path))
        {
            list.Add(new CreditJson {
                name = TFUtils.LoadString(dictionary, "Name"),
                size = TFUtils.LoadInt(dictionary, "Size")
            });
        }
        return(list.ToArray());
    }
示例#9
0
 public override void TFDefaults()
 {
     TFItemType        = "Party Favor";
     TFItemQuality     = (int)TFColorID.Unique;
     TFItemLevel       = 5;
     item.width        = 44;
     item.height       = 40;
     item.useStyle     = ItemUseStyleID.HoldingOut;
     item.useTime      = 70;
     item.useAnimation = 70;
     item.value        = Item.buyPrice(0);
     item.autoReuse    = true;
     downloads         = TFUtils.DownloadCountFormatted();
 }
示例#10
0
 // Token: 0x06000270 RID: 624 RVA: 0x00032518 File Offset: 0x00030918
 public static StudentEditorScript.StudentData Deserialize(Dictionary <string, object> dict)
 {
     return(new StudentEditorScript.StudentData {
         id = TFUtils.LoadInt(dict, "ID"),
         name = TFUtils.LoadString(dict, "Name"),
         isMale = (TFUtils.LoadInt(dict, "Gender") == 1),
         attendanceInfo = StudentEditorScript.StudentAttendanceInfo.Deserialize(dict),
         personality = StudentEditorScript.StudentPersonality.Deserialize(dict),
         stats = StudentEditorScript.StudentStats.Deserialize(dict),
         cosmetics = StudentEditorScript.StudentCosmetics.Deserialize(dict),
         scheduleBlocks = StudentEditorScript.DeserializeScheduleBlocks(dict),
         info = TFUtils.LoadString(dict, "Info")
     });
 }
 public static TopicJson[] LoadFromJson(string path)
 {
     TopicJson[] array = new TopicJson[101];
     foreach (Dictionary <string, object> d in JsonData.Deserialize(path))
     {
         int num = TFUtils.LoadInt(d, "ID");
         if (num == 0)
         {
             break;
         }
         array[num] = new TopicJson();
         TopicJson topicJson = array[num];
         topicJson.topics = new int[26];
         for (int j = 1; j <= 25; j++)
         {
             topicJson.topics[j] = TFUtils.LoadInt(d, j.ToString());
         }
     }
     return(array);
 }
 private static ScheduleBlock[] DeserializeScheduleBlocks(Dictionary <string, object> dict)
 {
     string[] array = TFUtils.LoadString(dict, "ScheduleTime").Split(new char[]
     {
         '_'
     });
     string[] array2 = TFUtils.LoadString(dict, "ScheduleDestination").Split(new char[]
     {
         '_'
     });
     string[] array3 = TFUtils.LoadString(dict, "ScheduleAction").Split(new char[]
     {
         '_'
     });
     ScheduleBlock[] array4 = new ScheduleBlock[array.Length];
     for (int i = 0; i < array4.Length; i++)
     {
         array4[i] = new ScheduleBlock(float.Parse(array[i]), array2[i], array3[i]);
     }
     return(array4);
 }