3 sprint(self, "Not done yet\n");
\r
6 void MedicGrenade(float req)
\r
9 atk_delay = cvar("g_balance_class_medic_grenade_delayattack");
\r
10 if(req == WR_GRENADE1)
\r
12 if(W_ThrowGrenade(W_PoisonGrenade))
\r
14 self.grenade_time = time + cvar("g_balance_grenade_poison_refire");
\r
15 // special: medic can't shoot for a while
\r
16 if(self.attack_finished < time + atk_delay)
\r
17 self.attack_finished = time + atk_delay;
\r
20 else if(req == WR_GRENADE2)
\r
22 if(W_ThrowGrenade(W_ArmorGrenade))
\r
24 self.grenade_time = time + cvar("g_balance_grenade_armor_refire");
\r
25 // special: medic can't shoot for a while
\r
26 if(self.attack_finished < time + atk_delay)
\r
27 self.attack_finished = time + atk_delay;
\r
32 void player_clearpoison(entity targ);
\r
34 void MedicPreThink()
\r
37 float maxhpratio, healamt, armoramt, reducestatus, didheal;
\r
39 if(self.special_time > time)
\r
41 self.special_time = time + cvar("g_balance_medic_heal_pingrate");
\r
43 maxhpratio = cvar("g_balance_medic_heal_max");
\r
44 healamt = cvar("g_balance_medic_heal_pingheal");
\r
45 armoramt = cvar("g_balance_medic_heal_pingarmor");
\r
46 reducestatus = cvar("g_balance_medic_heal_reducestatus");
\r
48 head = findradius(self.origin, cvar("g_balance_medic_heal_radius"));
\r
51 if(head.team == self.team && head.class != CLASS_MEDIC)// && head != self)
\r
53 if(head.classname == "player")
\r
56 if(head.health < head.max_health * maxhpratio)
\r
58 //bprint(strcat("heal hp ", ftos(head.health)));
\r
59 //bprint(strcat(" ", ftos(head.health + healamt)));
\r
60 //bprint(strcat(" ", ftos(head.max_health * maxhpratio), "\n"));
\r
61 head.health = bound(head.health,
\r
62 head.health + healamt,
\r
63 head.max_health * maxhpratio);
\r
64 //head.health = head.health + healamt;
\r
65 //if(head.health > head.max_health * maxhpratio)
\r
66 // head.health = head.max_health * maxhpratio;
\r
67 DelayHealthRot(head);
\r
70 if(head.armorvalue < head.max_armor * maxhpratio)
\r
72 //bprint("heal ar\n");
\r
73 head.armorvalue = bound(head.armorvalue,
\r
74 head.armorvalue + armoramt,
\r
75 head.max_armor * maxhpratio);
\r
76 DelayArmorRot(head);
\r
79 if(head.poison_damage)
\r
81 //bprint("heal poison\n");
\r
82 player_clearpoison(head);
\r
87 //bprint("heal fire\n");
\r
88 head.onfire.wait = time + (head.onfire.wait - time)*reducestatus;
\r
94 te_teleport(head.origin);
\r
102 void MedicPostThink()
\r
106 void BecomeMedic(float portion)
\r
108 self.max_health = cvar("g_balance_class_medic_health") * portion;
\r
110 self.max_armor = cvar("g_balance_class_medic_armor") * portion;
\r
112 self.mass = cvar("g_balance_class_medic_mass");
\r
114 SetPlayerSpeed(self);
\r
116 self.items = IT_WEP1 | IT_WEP2 | IT_WEP3 | IT_WEP4;
\r
117 self.switchweapon = WEP2;
\r
118 self.ammo_shells = floor(20 * portion);
\r
119 self.ammo_nails = floor(50 * portion);
\r
120 self.ammo_rockets = floor(0 * portion);
\r
121 self.ammo_cells = floor(0 * portion);
\r
122 self.playerclass = 5; // TF P.C.
\r
123 SetMaxAmmoFor (16);
\r