コード例 #1
0
ファイル: NPC.cs プロジェクト: rangerofthewest/Pangeo-dev
 public static void InitNPC()
 {
     npcs_data[0] = new NPC(24, 14, 0, 40, 5, 8, 6, 100, 0, 1.0, 1.0f, 1.2f, "Zombie", "Normal", false);
     npcs_data[1] = new NPC(24, 14, 0, 38, 3, 12, 8, 95, 0, 1.0, 1.2f, 1.1f, "Zombie", "High", true);
     npcs_data[2] = new NPC(24, 14, 0, 44, 6, 10, 6, 110, 0, 1.1, 1.0f, 1.15f, "Zombie", "Classy", true);
     npcs_data[3] = new NPC(12, 14, 0, 40, 5, 8, 6, 100, 0, 1.4, 1.0f, 1.2f, "Zombie", "Blur", true);
     npcs_data[4] = new NPC(24, 0, 1, 30, 3, 8, 6, 90, 0, 1.2, 0.7f, 1.0f, "Ghost", "Transparent", false); //0 is basic AI, 1 is ghost AI
     npcs_data[5] = new NPC(24, 0, 1, 35, 5, 8, 7, 110, 0, 1.4, 0.7f, 1.0f, "Ghost", "Angry", true);
     npcs_data[6] = new NPC(24, 0, 1, 28, 4, 8, 6, 100, 0, 1.2, 0.7f, 1.0f, "Ghost", "Bored", true);
     npcs_data[7] = new NPC(24, 0, 1, 32, 1, 8, 4, 90, 0, 1.2, 0.7f, 1.0f, "Ghost", "Sad", true);
     npcs_data[8] = new NPC(24, 0, 1, 30, 1, 8, 6, 80, 0, 1.2, 0.7f, 1.0f, "Ghost", "Happy", true);
 }
コード例 #2
0
ファイル: NPC.cs プロジェクト: rangerofthewest/Pangeo-dev
 public static void NewNPC(NPC npc, int x, int y)
 {
     lastnpcid++;
     npcs[lastnpcid] = npc;
     npcs[lastnpcid].position = new Vector2(x, y);
 }
コード例 #3
0
ファイル: NPC.cs プロジェクト: rangerofthewest/Pangeo-dev
 public static void GrantAttributes(NPC npc)
 {
     bool gen_suffix = false;
     bool gen_prefix = false;
     //Step 1: Determine if we should generate attributes for our NPC
     if (Main.rand.Next(8) != 0)
     {
         return;
     }
     //Ok, so we have a 12.5% chance of generating an attribute
     //Step 2: Determine if to generate a suffix and a prefix or one of them. One of them will be picked or both will be picked
     while (!gen_suffix || !gen_prefix)
     {
         if (Main.rand.Next(52) == 0)
         {
             gen_suffix = true;
         }
         if (Main.rand.Next(45) == 0)
         {
             gen_prefix = true;
         }
         //We have 3 options here: prefix is generated, a suffix is generated, or both are generated
         //Chance of having both suffix and prefix is 1 in 2340, which is extremely low
     }
     //Step 3: Assign attributes. We will determine them from an array of possible name mods
     //There will be a different system later on
     //Determine what will be edited
     int mod_suffix = Main.rand.Next(6); //0 is attack, 1 is defense, 2 is immunities, 3 is speed, 4 is size, and 5 is knockback
     int mod_prefix = Main.rand.Next(6); //See above comment
 }