MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / adjustRelationTo

Method adjustRelationTo

game/state/shared/organisation.cpp:779–787  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

777}
778
779void Organisation::adjustRelationTo(GameState &state, StateRef<Organisation> other, float value)
780{
781 current_relations[other] = clamp(current_relations[other] + value, -100.0f, 100.0f);
782 // Mirror player relations except in battle
783 if (!state.current_battle && other == state.getPlayer())
784 {
785 other->current_relations[{&state, id}] = current_relations[other];
786 }
787}
788
789Organisation::Relation Organisation::isRelatedTo(const StateRef<Organisation> &other) const
790{

Callers 7

executeMethod · 0.80
dieMethod · 0.80
fallUnconsciousMethod · 0.80
eventOccurredMethod · 0.80
eventOccurredMethod · 0.80

Calls 2

clampFunction · 0.85
getPlayerMethod · 0.80

Tested by

no test coverage detected