-
Notifications
You must be signed in to change notification settings - Fork 3
/
Pokedex.cs
122 lines (118 loc) · 5.27 KB
/
Pokedex.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
using Newtonsoft.Json;
using System.Collections.Generic;
namespace PokeModBlue {
public static class Pokedex {
public static Dictionary<float, PokedexEntry> pokedex = new Dictionary<float, PokedexEntry>();
static Pokedex() {
List<PokedexEntry> _pokedex = JsonConvert.DeserializeObject<List<PokedexEntry>>(PokedexJSON._pokedexJSON, new PokedexEntryConverter());
foreach (PokedexEntry _pokedexEntry in _pokedex) {
pokedex.Add(_pokedexEntry.Nat, _pokedexEntry);
/*
using (StreamWriter writer = new StreamWriter("\\Weapons\\" +_pokedexEntry.Pokemon +"Pokeball.cs"))
{
writer.WriteLine("using System;");
writer.WriteLine("using Microsoft.Xna.Framework;");
writer.WriteLine("using Terraria;");
writer.WriteLine("using Terraria.ID;");
writer.WriteLine("using Terraria.ModLoader;");
writer.WriteLine("");
writer.WriteLine("namespace PokeModBlue.Items.Weapons {");
writer.WriteLine("");
writer.WriteLine(" public class " +_pokedexEntry.Pokemon +"Pokeball : PokemonWeapon");
writer.WriteLine(" {");
writer.WriteLine(" public override float id {get{return " +_pokedexEntry.Nat +"f;}}");
writer.WriteLine(" ");
writer.WriteLine(" public override void SetDefaults()");
writer.WriteLine(" {");
writer.WriteLine(" base.SetDefaults();");
writer.WriteLine(" }");
writer.WriteLine(" }");
writer.WriteLine("}");
}
using (StreamWriter writer = new StreamWriter("\\Buffs\\" +_pokedexEntry.Pokemon +"Buff.cs"))
{
writer.WriteLine("using System;");
writer.WriteLine("using Terraria;");
writer.WriteLine("using Terraria.ModLoader;");
writer.WriteLine("");
writer.WriteLine("namespace PokeModBlue.Buffs {");
writer.WriteLine("");
writer.WriteLine(" public class " +_pokedexEntry.Pokemon +"Buff" +" : PokeBuff");
writer.WriteLine(" {");
writer.WriteLine(" public override float id {get{return " +_pokedexEntry.Nat +"f;}}");
writer.WriteLine(" }");
writer.WriteLine("}");
}
using (StreamWriter writer = new StreamWriter("\\NPCs\\" +_pokedexEntry.Pokemon +".cs"))
{
writer.WriteLine("using System;");
writer.WriteLine("using Microsoft.Xna.Framework;");
writer.WriteLine("using Terraria;");
writer.WriteLine("using Terraria.ID;");
writer.WriteLine("using Terraria.ModLoader;");
writer.WriteLine("");
writer.WriteLine("namespace PokeModBlue.NPCs.Pokemon {");
writer.WriteLine("");
writer.WriteLine(" public class " +_pokedexEntry.Pokemon +" : PokemonNPC");
writer.WriteLine(" {");
writer.WriteLine(" public override float id {get{return " +_pokedexEntry.Nat +"f;}}");
writer.WriteLine(" ");
writer.WriteLine(" public override void SetDefaults()");
writer.WriteLine(" {");
writer.WriteLine(" base.SetDefaults();");
writer.WriteLine(" npc.width = 20;");
writer.WriteLine(" npc.height = 20;");
writer.WriteLine(" Main.npcFrameCount[npc.type] = 3;");
writer.WriteLine(" }");
writer.WriteLine(" }");
writer.WriteLine("}");
}
using (StreamWriter writer = new StreamWriter("\\Sounds\\Item\\" +"id" +_pokedexEntry.Nat +".cs"))
{
writer.WriteLine("using Microsoft.Xna.Framework.Audio;");
writer.WriteLine("using Terraria;");
writer.WriteLine("using Terraria.ModLoader;");
writer.WriteLine("");
writer.WriteLine("namespace PokeModBlue.Sounds.Item");
writer.WriteLine("{");
writer.WriteLine(" public class " +"id" +_pokedexEntry.Nat +" : ModSound");
writer.WriteLine(" {");
writer.WriteLine(" public override void PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type)");
writer.WriteLine(" {");
writer.WriteLine(" soundInstance = sound.CreateInstance();");
writer.WriteLine(" soundInstance.Volume = volume;");
writer.WriteLine(" soundInstance.Pan = pan;");
writer.WriteLine(" soundInstance.Pitch = 1.0f;");
writer.WriteLine(" Main.PlaySoundInstance(soundInstance);");
writer.WriteLine(" }");
writer.WriteLine(" }");
writer.WriteLine("}");
}
using (StreamWriter writer = new StreamWriter("\\Sounds\\NPCKilled\\" +"id" +_pokedexEntry.Nat +".cs"))
{
writer.WriteLine("using Microsoft.Xna.Framework.Audio;");
writer.WriteLine("using Terraria;");
writer.WriteLine("using Terraria.ModLoader;");
writer.WriteLine("");
writer.WriteLine("namespace PokeModBlue.Sounds.NPCKilled");
writer.WriteLine("{");
writer.WriteLine(" public class " +"id" +_pokedexEntry.Nat +" : ModSound");
writer.WriteLine(" {");
writer.WriteLine(" public override void PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type)");
writer.WriteLine(" {");
writer.WriteLine(" soundInstance = sound.CreateInstance();");
writer.WriteLine(" soundInstance.Volume = volume;");
writer.WriteLine(" soundInstance.Pan = pan;");
writer.WriteLine(" soundInstance.Pitch = 0.8f;");
writer.WriteLine(" Main.PlaySoundInstance(soundInstance);");
writer.WriteLine(" }");
writer.WriteLine(" }");
writer.WriteLine("}");
}
*/
}
}
public static void DoNothing() {
}
}
}