1
0
Fork 0
forked from fte/fteqw

*** empty log message ***

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1780 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Magnus 2006-01-03 04:02:08 +00:00
parent 975a0a2cc4
commit 482b7879a7
6 changed files with 140 additions and 58 deletions

View file

@ -108,7 +108,7 @@ void() SetNewParms =
parm16 = 1; parm16 = 1;
parm17 = SlotVal(IID_WP_AK74, 30); parm17 = SlotVal(IID_WP_AK74, 30);
parm18 = SlotVal(IID_GREN_SMOKE, 500); parm18 = SlotVal(IID_GREN_SMOKE, 5);
parm19 = SlotVal(IID_ARM_LEATHER, 1); parm19 = SlotVal(IID_ARM_LEATHER, 1);
parm20 = SlotVal(IID_AM_AK74, 120); parm20 = SlotVal(IID_AM_AK74, 120);
parm21 = SlotVal(IID_AM_MOONLIGHT, 120); parm21 = SlotVal(IID_AM_MOONLIGHT, 120);

View file

@ -265,6 +265,10 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage =
// do the damage // do the damage
//different sorts of armour simply subtract different ammounts //different sorts of armour simply subtract different ammounts
//this makes armor like the force armor good against many small rounds
//(SMG, shotguns, swords, etc) but useless against big damage (grenades)
//power armor, which has the best of both worlds, is also the heaviest :p
switch(ToIID(targ.islot3)) switch(ToIID(targ.islot3))
{ {
case IID_ARM_SHIRT: case IID_ARM_SHIRT:

View file

@ -233,8 +233,8 @@ void () door_touch =
{ {
if (self.size_y <= 128 && self.size_x <= 128) if (self.size_y <= 128 && self.size_x <= 128)
{ {
if (other.class == 4) if (other.class == 2 || other.class == 4) //assassins as well as scientists
{ { //can open doors for more freedom
SpawnOpenDoor(self, other); SpawnOpenDoor(self, other);
return; return;
} }

View file

@ -252,6 +252,40 @@ float(entity e, float iid) SlotOfItem =
return 0; return 0;
}; };
float(entity e) FindEmptySlot =
{
if (ToIID(e.islot3) == IID_NONE)
return 3;
if (ToIID(e.islot4) == IID_NONE)
return 4;
if (ToIID(e.islot5) == IID_NONE)
return 5;
if (ToIID(e.islot6) == IID_NONE)
return 6;
if (ToIID(e.islot7) == IID_NONE)
return 7;
if (ToIID(e.islot8) == IID_NONE)
return 8;
if (ToIID(e.islot9) == IID_NONE)
return 9;
if (ToIID(e.islot10) == IID_NONE)
return 10;
if (ToIID(e.islot11) == IID_NONE)
return 11;
if (ToIID(e.islot12) == IID_NONE)
return 12;
if (ToIID(e.islot13) == IID_NONE)
return 13;
if (ToIID(e.islot14) == IID_NONE)
return 14;
if (ToIID(e.islot15) == IID_NONE)
return 15;
if (ToIID(e.islot16) == IID_NONE)
return 16;
return 0;
};
typedef .float slot_t; typedef .float slot_t;
slot_t(float slot) SlotField = slot_t(float slot) SlotField =
{ {

View file

@ -3,8 +3,8 @@
void(float cost, float type) BuyGrenade = void(float cost, float type) BuyGrenade =
{ {
local string y; local string z;
local float x; local float x, y;
if (self.ammo_shells < cost) if (self.ammo_shells < cost)
{ {
@ -13,32 +13,34 @@ void(float cost, float type) BuyGrenade =
return; return;
} }
if (self.equipment == 4)
x = 2;
else
x = 1;
if (self.handgrenade >= x)
{
self.currentmenu = "none";
sprint(self, PRINT_HIGH, "already have a grenade.\n");
return;
}
sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM);
self.handgrenade = self.handgrenade + 1;
self.grenadetype = type;
self.ammo_shells = self.ammo_shells - cost; self.ammo_shells = self.ammo_shells - cost;
y = ftos(self.bandages);
sprint(self, PRINT_HIGH, "you bought a ");
if (type == 1)
sprint(self, PRINT_HIGH, "smoke grenade.\n");
if (type == 2)
sprint(self, PRINT_HIGH, "frag grenade.\n");
if (type == 3)
sprint(self, PRINT_HIGH, "emp grenade.\n");
};
sprint(self, PRINT_HIGH, "you bought a ");
if (type == 1)
y = IID_GREN_SMOKE;
if (type == 2)
y = IID_GREN_FRAG;
if (type == 3)
y = IID_GREN_EMP;
z = GetItemName(y);
sprint(self, PRINT_HIGH, z);
sprint(self, PRINT_HIGH, "\n");
//put grenade in inventory
//finds existing grenades, otherwise, empty slot
x = SlotOfItem(self, y);
if (x != 0) //found existing grenades
SetItemSlot(self, x, SlotVal(y, 1));
if (x == 0)
x = FindEmptySlot(self);
SetItemSlot(self, x, SlotVal(y, 1));
};
void() BuyBandages = void() BuyBandages =
{ {
@ -265,9 +267,10 @@ void (float cost, float item) BuyPerk =
return; return;
}; };
/*
void (float wt, float cost, float item) BuyArmor = void (float wt, float cost, float item) BuyArmor =
{ {
/*
local float curr; local float curr;
local float lbs; local float lbs;
local string x; local string x;
@ -300,7 +303,43 @@ void (float wt, float cost, float item) BuyArmor =
sprint (self, PRINT_HIGH, " purchased.\n"); sprint (self, PRINT_HIGH, " purchased.\n");
return; return;
*/
};*/
void (float wt, float cost, float item) BuyArmor =
{
local string z;
local float x, y;
if (self.ammo_shells < cost)
{
self.currentmenu = "none";
sound (self, CHAN_BODY, "misc/menu3.wav", 1, ATTN_IDLE);
sprint(self, PRINT_HIGH, "not enough money.\n");
return;
}
sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM);
self.ammo_shells = self.ammo_shells - cost;
sprint(self, PRINT_HIGH, "you bought ");
z = GetItemName(item);
sprint(self, PRINT_HIGH, z);
sprint(self, PRINT_HIGH, ".\n");
//put new armor in armor slot
//put old armor in inventory
x = FindEmptySlot(self);
if (x == 0)
sprint(self, 2, "no more room. giving armor to merchant.\n");
if (x != 0) //found a place to stick old armor
SetItemSlot(self, x, SlotVal(self.islot3, 1));
SetItemSlot(self, 3, SlotVal(item, 1));
}; };
void (float cost, float item) BuyEquipment = void (float cost, float item) BuyEquipment =
@ -506,21 +545,21 @@ void() W_PlayerMenu =
if (self.currentmenu == "shop_armor") if (self.currentmenu == "shop_armor")
{ {
if (self.impulse == 1) if (self.impulse == 1)
BuyArmor(3, 03, 1); //weight, cost, item BuyArmor(3, 03, IID_ARM_SHIRT); //weight, cost, item
if (self.impulse == 2) if (self.impulse == 2)
BuyArmor(7, 05, 2); //weight, cost, item BuyArmor(7, 05, IID_ARM_LEATHER); //weight, cost, item
if (self.impulse == 3) if (self.impulse == 3)
BuyArmor(9, 10, 3); //weight, cost, item BuyArmor(9, 10, IID_ARM_KEVLAR); //weight, cost, item
if (self.impulse == 4) if (self.impulse == 4)
BuyArmor(15, 12, 4); //weight, cost, item BuyArmor(15, 12, IID_ARM_METAL); //weight, cost, item
if (self.impulse == 5) if (self.impulse == 5)
BuyArmor(12, 25, 5); //weight, cost, item BuyArmor(12, 25, IID_ARM_COMBAT); //weight, cost, item
if (self.impulse == 6) if (self.impulse == 6)
BuyArmor(17, 35, 6); //weight, cost, item BuyArmor(17, 35, IID_ARM_BROTHERHOOD); //weight, cost, item
if (self.impulse == 7) if (self.impulse == 7)
BuyArmor(5, 45, 7); //weight, cost, item BuyArmor(5, 45, IID_ARM_FORCE); //weight, cost, item
if (self.impulse == 8) if (self.impulse == 8)
BuyArmor(20, 55, 8); //weight, cost, item BuyArmor(20, 55, IID_ARM_LPOWER); //weight, cost, item
return; return;
} }

View file

@ -3,8 +3,8 @@
void(float cost, float type) BuyGrenade = void(float cost, float type) BuyGrenade =
{ {
local string y; local string z;
local float x; local float x, y;
if (self.ammo_shells < cost) if (self.ammo_shells < cost)
{ {
@ -13,30 +13,35 @@ void(float cost, float type) BuyGrenade =
return; return;
} }
if (self.equipment == 4)
x = 2;
else
x = 1;
if (self.handgrenade >= x)
{
self.currentmenu = "none";
sprint(self, PRINT_HIGH, "already have a grenade.\n");
return;
}
sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM);
self.handgrenade = self.handgrenade + 1;
self.grenadetype = type;
self.ammo_shells = self.ammo_shells - cost; self.ammo_shells = self.ammo_shells - cost;
y = ftos(self.bandages);
sprint(self, PRINT_HIGH, "you bought a "); sprint(self, PRINT_HIGH, "you bought a ");
if (type == 1) if (type == 1)
sprint(self, PRINT_HIGH, "smoke grenade.\n"); y = IID_GREN_SMOKE;
if (type == 2) if (type == 2)
sprint(self, PRINT_HIGH, "frag grenade.\n"); y = IID_GREN_FRAG;
if (type == 3) if (type == 3)
sprint(self, PRINT_HIGH, "emp grenade.\n"); y = IID_GREN_EMP;
z = GetItemName(y);
sprint(self, PRINT_HIGH, z);
sprint(self, PRINT_HIGH, "\n");
//put grenade in inventory
//finds existing grenades, otherwise, empty slot
x = SlotOfItem(self, y);
SlotVal(IID_GREN_SMOKE, 500)
if (x != 0) //found existing grenades
SetItemSlot(self, x, SlotVal(y, 1));
if (x == 0)
x = FindEmptySlot(self, y);
SetItemSlot(self, x, SlotVal(y, 1));
}; };