if (achieve == "multirailed") this.multirailed = value;
if (achieve == "pointblank") this.pointblank = value;
+ if (achieve == "selfimmolation") this.selfimmolation = value;
return;
}
if (achieve == "multirailed") return this.multirailed;
if (achieve == "pointblank") return this.pointblank;
+ if (achieve == "selfimmolation") return this.selfimmolation;
return 0;
}
//New achievements
ATTRIB(Achievements, multirailed, int, 0);
ATTRIB(Achievements, pointblank, int, 0);
+ ATTRIB(Achievements, selfimmolation, int, 0);
//Getters and setters for achievements
METHOD(Achievements, set_achievement_value, void(Achievements this, string achieve, int value));
this.shotgun_inc_pointblank = 0;
}
}
+
+ //Check suicide
+ if (this.check_suicide) {
+
+ if (this.suicide) {
+ entity achv = this.achievements;
+ achv.inc_achievement(achv, "selfimmolation");
+ achv.announce(achv, this, "Self-Immolation!", "selfimmolation");
+ }
+
+ this.suicide = 0;
+ this.check_suicide = 0;
+ }
}
void DrownPlayer(entity this)
ATTRIB(Player, shotgun_timer, bool, this.shotgun_timer);
ATTRIB(Player, shotgun_bullets_received_from, entity, this.shotgun_bullets_received_from);
ATTRIB(Player, shotgun_inc_pointblank, bool, this.shotgun_inc_pointblank);
+ ATTRIB(Player, check_suicide, bool, this.check_suicide);
+ ATTRIB(Player, suicide, bool, this.suicide);
INIT(Player) {
this.classname = STR_PLAYER;
LogDeath("suicide", deathtype, targ, targ);
if(deathtype != DEATH_AUTOTEAMCHANGE.m_id) // special case: don't negate frags if auto switched
GiveFrags(attacker, targ, -1, deathtype, weaponentity);
+
+ attacker.suicide = 1;
+ }
+
+ if (targ != attacker) {
+ attacker.check_suicide = 1;
}
// ======