SHARE
TWEET

Untitled

a guest May 19th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class EnemyNPC
  2. {
  3. public:
  4.     //Enemy NPC
  5.     int Erp = 15;
  6.     int Ecp = 70;
  7.     char esprite[17] = { '_','\\','_','|','@','-','@','|','c','|','_','_','_','|','c','|','|' };
  8.     char epistol[3] = { '-','-','-' };
  9.     int NPC_En = 0;
  10.     int NPC_En_terminate = 0;
  11.     int En_aggro = 0;
  12.  
  13.     void setenemy(char game[][80], player &x)
  14.     {
  15.         if (NPC_En == 1)
  16.         {
  17.             game[Erp][Ecp] = esprite[0]; //head
  18.             game[Erp][Ecp + 1] = esprite[1]; //antenna left
  19.             game[Erp][Ecp + 2] = esprite[2]; //head
  20.             game[Erp + 1][Ecp - 1] = esprite[3]; //head
  21.             game[Erp + 1][Ecp] = esprite[4]; //left eye
  22.             game[Erp + 1][Ecp + 1] = esprite[5]; //mouth
  23.             game[Erp + 1][Ecp + 2] = esprite[6]; //right eye
  24.             game[Erp + 1][Ecp + 3] = esprite[7]; //head
  25.             game[Erp + 2][Ecp - 2] = esprite[8]; //left arm
  26.             game[Erp + 2][Ecp - 1] = esprite[9]; //body
  27.             game[Erp + 2][Ecp] = esprite[10]; //body
  28.             game[Erp + 2][Ecp + 1] = esprite[11]; //body
  29.             game[Erp + 2][Ecp + 2] = esprite[12]; //body
  30.             game[Erp + 2][Ecp + 3] = esprite[13]; //body
  31.             game[Erp + 2][Ecp + 4] = esprite[14]; //right arm
  32.             game[Erp + 3][Ecp] = esprite[15]; //left leg
  33.             game[Erp + 3][Ecp + 2] = esprite[16]; //right leg
  34.             game[Erp + 2][Ecp - 3] = epistol[0];
  35.             game[Erp + 2][Ecp - 4] = epistol[1];
  36.             game[Erp + 2][Ecp - 5] = epistol[2];
  37.             game[Erp - 1][Ecp - 1] = x.healthbar;
  38.             game[Erp - 1][Ecp] = x.healthbar;
  39.             game[Erp - 1][Ecp + 1] = x.healthbar;
  40.             game[Erp - 1][Ecp + 2] = x.healthbar;
  41.             game[Erp - 1][Ecp + 3] = x.healthbar;
  42.         }
  43.         if (NPC_En_terminate == 1)
  44.         {
  45.             game[Erp][Ecp] = ' '; //head
  46.             game[Erp][Ecp + 1] = ' '; //antenna left
  47.             game[Erp][Ecp + 2] = ' '; //head
  48.             game[Erp + 1][Ecp - 1] = ' '; //head
  49.             game[Erp + 1][Ecp] = ' '; //left eye
  50.             game[Erp + 1][Ecp + 1] = ' '; //mouth
  51.             game[Erp + 1][Ecp + 2] = ' '; //right eye
  52.             game[Erp + 1][Ecp + 3] = ' '; //head
  53.             game[Erp + 2][Ecp - 2] = ' '; //left arm
  54.             game[Erp + 2][Ecp - 1] = ' '; //body
  55.             game[Erp + 2][Ecp] = ' '; //body
  56.             game[Erp + 2][Ecp + 1] = ' '; //body
  57.             game[Erp + 2][Ecp + 2] = ' '; //body
  58.             game[Erp + 2][Ecp + 3] = ' '; //body
  59.             game[Erp + 2][Ecp + 4] = ' '; //right arm
  60.             game[Erp + 3][Ecp] = ' '; //left leg
  61.             game[Erp + 3][Ecp + 2] = ' '; //right leg
  62.             game[Erp + 2][Ecp - 3] = ' ';
  63.             game[Erp + 2][Ecp - 4] = ' ';
  64.             game[Erp + 2][Ecp - 5] = ' ';
  65.             game[Erp - 1][Ecp - 1] = ' ';
  66.             game[Erp - 1][Ecp] = ' ';
  67.             game[Erp - 1][Ecp + 1] = ' ';
  68.             game[Erp - 1][Ecp + 2] = ' ';
  69.             game[Erp - 1][Ecp + 3] = ' ';
  70.         }
  71.     }
  72.     void attack(char game[][80], player &x)
  73.     {
  74.         int En_b1r = 0, En_b1c = 0, En_firetrigger = 0, En_damage = 0;
  75.         int En_speed = 1, En_damage_multiplier = 0;
  76.         char En_Bsprite = '-';
  77.         char En_Btrail[3] = { '-', '-' , '-' }; //bullet trail for rocket launcher//
  78.         int En_trail = 0;
  79.  
  80.         //Attack stats://
  81.         En_speed = 1;
  82.         En_damage_multiplier = 60;
  83.         En_Bsprite = '<';
  84.         En_trail = 1;
  85.         En_Btrail[0] = '=';
  86.         En_Btrail[1] = '-';
  87.         En_Btrail[2] = '*';
  88.  
  89.         if (NPC_En == 1 && En_firetrigger == 0 && x.Hcp > 10)
  90.         {
  91.             En_b1r = Erp + 2;
  92.             En_b1c = Ecp - 5;
  93.             En_firetrigger = 1;
  94.         }
  95.  
  96.         //Enemy bullet firing
  97.         if (En_firetrigger == 1 && En_b1c != 1 && NPC_En_terminate != 1 && NPC_En == 1)
  98.         {
  99.             game[En_b1r][En_b1c] = ' ';
  100.             if (En_b1c != 1 && game[En_b1r][En_b1c - 1] != x.sprite[12])
  101.             {
  102.                 En_b1c--;
  103.             }
  104.             if (En_b1c != 1 && game[En_b1r][En_b1c - 1] != x.sprite[12] && En_speed > 1)
  105.             {
  106.                 En_b1c--;
  107.             }
  108.             if (En_b1c != 1 && game[En_b1r][En_b1c - 1] != x.sprite[12] && En_speed > 2)
  109.             {
  110.                 En_b1c--;
  111.             }
  112.             game[En_b1r][En_b1c] = En_Bsprite;
  113.             if (game[En_b1r][En_b1c - 1] == x.sprite[12])
  114.             {
  115.                 x.health -= En_damage_multiplier;
  116.                 En_firetrigger = 0;
  117.                 game[En_b1r][En_b1c] = ' ';
  118.             }
  119.         }
  120.         else
  121.         {
  122.             game[En_b1r][En_b1c] = ' ';
  123.             En_firetrigger = 0;
  124.         }
  125.     }
  126. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top