~armagetronad-dev/armagetronad/0.4-armagetronad-fortress_ai

« back to all changes in this revision

Viewing changes to src/tron/zone/zEffector.cpp

  • Committer: Manuel Moos
  • Date: 2019-10-11 21:15:52 UTC
  • mfrom: (2341.1.771 master)
  • Revision ID: z-man@users.sf.net-20191011211552-nt5bcs279pcmyodk
MergeĀ fromĀ 0.4/master

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include "gGame.h"
31
31
// Only for SpawnPlayer:
32
32
#include "gParser.h"
 
33
#include "eLadderLog.h"
33
34
 
34
35
 
35
36
void zEffector::apply(gVectorExtra<ePlayerNetID *> &d_calculatedTargets)
162
163
void
163
164
zEffectorManager::Register(std::string const & type, std::string const & desc, NullFactory_t f)
164
165
{
165
 
    _effectors().insert(std::make_pair(type, new NullFactory(f)));
 
166
    _effectors()[type] = boost::shared_ptr<NullFactory>(new NullFactory(f));
166
167
}
167
168
void
168
169
zEffectorManager::Register(std::string const & type, std::string const & desc, XMLFactory_t f)
169
170
{
170
 
    _effectors().insert(std::make_pair(type, new XMLFactory(f)));
 
171
    _effectors()[type] = boost::shared_ptr<XMLFactory>( new XMLFactory(f));
171
172
}
172
173
 
173
174
 
 
175
bool sz_wz_player_win = true;
 
176
static tSettingItem<bool> wzpw("WIN_ZONE_PLAYER_WIN",sz_wz_player_win);
 
177
 
174
178
static zEffectorRegistration regWin("win", "", zEffectorWin::create);
175
179
 
 
180
static eLadderLogWriter sg_winZoneWriter( "WINZONE_PLAYER_ENTER", true, "player" );
 
181
 
176
182
void zEffectorWin::effect(gVectorExtra<ePlayerNetID *> &d_calculatedTargets)
177
183
{
178
184
    // BOP
184
190
            iter != d_calculatedTargets.end();
185
191
            ++iter)
186
192
    {
187
 
        sg_DeclareWinner((*iter)->CurrentTeam(), message );
 
193
        sg_winZoneWriter << (*iter)->GetUserName();
 
194
        sg_winZoneWriter.write();
 
195
        if(sz_wz_player_win)
 
196
            sg_DeclareWinner((*iter)->CurrentTeam(), message );
188
197
    }
189
198
}
190
199
 
199
208
 
200
209
static zEffectorRegistration regDeath("death", "", zEffectorDeath::create);
201
210
 
 
211
static eLadderLogWriter sg_deathZoneWriter( "DEATH_DEATHZONE", true, "player" );
 
212
 
202
213
void zEffectorDeath::effect(gVectorExtra<ePlayerNetID *> &d_calculatedTargets)
203
214
{
204
215
    gVectorExtra<ePlayerNetID *>::iterator iter;
207
218
            ++iter)
208
219
    {
209
220
        (*iter)->AddScore(sz_score_deathzone, tOutput(), "$player_lose_suicide");
 
221
        sg_deathZoneWriter << (*iter)->GetUserName();
 
222
        sg_deathZoneWriter.write();
210
223
        (*iter)->Object()->Kill();
211
224
    }
212
225
}