コード例 #1
0
void CreatureAttributes::initializeLastingEffects() {
  for (LastingEffect effect : ENUM_ALL(LastingEffect))
    lastingEffects[effect] = GlobalTime(-500);
  for (auto effect : ENUM_ALL(LastingEffect))
    if (body->isIntrinsicallyAffected(effect))
      ++permanentEffects[effect];
}
コード例 #2
0
bool CreatureAttributes::considerTimeout(LastingEffect effect, GlobalTime current) {
  if (lastingEffects[effect] > GlobalTime(0) && lastingEffects[effect] <= current) {
    clearLastingEffect(effect);
    if (!isAffected(effect, current))
      return true;
  }
  return false;
}
コード例 #3
0
ファイル: spell_map.cpp プロジェクト: akien-mga/keeperrl
void SpellMap::add(SpellId id) {
  if (!elems[id])
    elems[id] = GlobalTime(-10000);
}
コード例 #4
0
void CreatureAttributes::clearLastingEffect(LastingEffect effect) {
  lastingEffects[effect] = GlobalTime(0);
}