djcev.com

//

Git Repos / fte_dogmode / qc / triggers / setcount.qc

Last update to this file was on 2024-03-24 at 02:40.

Show setcount.qc

//==============================================================================
// target_setcount
//==============================================================================

//======================================================================
// forward declarations
//======================================================================

void(string name, .string fld) target_setcount_set;
void() target_setcount_use;
void(entity e) target_setcount_init;
void() target_setcount;

//------------------------------------------------------------------------------

//----------------------------------------------------------------------
// target_setcount
//----------------------------------------------------------------------
// class target_setcount: base_trigger
// {
//--------------------------------------------------------------
void(string name, .string fld) target_setcount_set =
{
local entity t;

t = find (world, fld, name);

while (t)
{
if (self.style == 1)
t.count += self.count;
else
t.count = self.count;

t = find (t, fld, name);
}
};

//--------------------------------------------------------------
void() target_setcount_use =
{
if (self.target && self.target != "")
{
target_setcount_set (self.target, targetname);
target_setcount_set (self.target, targetname2);
target_setcount_set (self.target, targetname3);
target_setcount_set (self.target, targetname4);
}
if (self.target2 && self.target2 != "")
{
target_setcount_set (self.target2, targetname);
target_setcount_set (self.target2, targetname2);
target_setcount_set (self.target2, targetname3);
target_setcount_set (self.target2, targetname4);
}
if (self.target3 && self.target3 != "")
{
target_setcount_set (self.target3, targetname);
target_setcount_set (self.target3, targetname2);
target_setcount_set (self.target3, targetname3);
target_setcount_set (self.target3, targetname4);
}
if (self.target4 && self.target4 != "")
{
target_setcount_set (self.target4, targetname);
target_setcount_set (self.target4, targetname2);
target_setcount_set (self.target4, targetname3);
target_setcount_set (self.target4, targetname4);
}

if (self.spawnflags & 1)
{
if (self.style == 1)
activator.count += activator.count;
else
activator.count = activator.count;
}
};

//--------------------------------------------------------------
void(entity e) target_setcount_init =
{
e.classname = "target_setcount";
e.classtype = CT_TARGET_SETCOUNT;
e.use = target_setcount_use;
base_mapentity_init (e);
};

//--------------------------------------------------------------
void() target_setcount =
{
// new spawnflags for all entities -- iw
if (SUB_Inhibit())
return;

target_setcount_init (self);
};
// };

Return to the top of this page or return to the overview of this repo.

Log setcount.qc

Date Commit Message Author + -
2024-03-24 2nd pass refactor, rework QC class structure cev +56 -35
2024-01-09 Continue OO / Class-based refactor cev +5 -4
2023-12-09 Start OO / class-based refactor, work on items cev +76  

Return to the top of this page or return to the overview of this repo.