Exemplo n.º 1
0
 void HealAndPatronsGenerarion()
 {
     for (int i = 0; i < 12; i++)//fill array a heal and patrons
     {
         int f = 0;
         while (f == 0)
         {
             int x = (int)((int)r.Next(MZ));
             int y = (int)((int)r.Next(MZ));
             if (maze[x,y] == 0)
             {
                 maze[x,y] = 3;
                 subject s = new subject();
                 s.setAmount((int)r.Next() + 25);
                 s.setPosition(x, y);
                 subj.Add(s);
                 f = 1;
             }
         }
         f = 0;
         while (f == 0)
         {
             int x = (int)((int)r.Next(MZ));
             int y = (int)((int)r.Next(MZ));
             if (maze[x,y] == 0)
             {
                 maze[x,y] = 4;
                 subject s = new subject();
                 s.setAmount(12);
                 s.setPosition(x, y);
                 subj.Add(s);
                 f = 1;
             }
         }
     }
 }
Exemplo n.º 2
0
 void RaiseSubject(NPC npc, subject sub)//!
 {
     if (sub.getAmount() == 12)
         npc.upAmmo(sub.getAmount());
     else
         npc.heal(sub.getAmount());
     subj.Remove(sub);
 }