-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adjusted: poison dose is now calculated from the perks, so it would be the same as using it form the inventory. Tested with the Vanilla Perks, Adamant, Ordinator, Vokrii. If there is somewhere a special implementation that was missed there is a setting to overwrite it (Misc Settings>Behavior Settings>Overwrite Poison Dose and Poison Dose) there it can be set manually.
- Loading branch information
Showing
15 changed files
with
128 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include "perk_visitor.h" | ||
#include "util/string_util.h" | ||
|
||
namespace util { | ||
|
||
RE::PerkEntryVisitor::ReturnType perk_visitor::Visit(RE::BGSPerkEntry* perk_entry) { | ||
const auto* entry_point = static_cast<RE::BGSEntryPointPerkEntry*>(perk_entry); | ||
const auto* perk = entry_point->perk; | ||
|
||
logger::trace("form id {}, name {}"sv, string_util::int_to_hex(perk->formID), perk->GetName()); | ||
|
||
if (entry_point->functionData) { | ||
const RE::BGSEntryPointFunctionDataOneValue* value = | ||
static_cast<RE::BGSEntryPointFunctionDataOneValue*>(entry_point->functionData); | ||
if (entry_point->entryData.function == RE::BGSEntryPointPerkEntry::EntryData::Function::kSetValue) { | ||
result_ = value->data; | ||
} else if (entry_point->entryData.function == RE::BGSEntryPointPerkEntry::EntryData::Function::kAddValue) { | ||
result_ += value->data; | ||
} else if (entry_point->entryData.function == | ||
RE::BGSEntryPointPerkEntry::EntryData::Function::kMultiplyValue) { | ||
result_ *= value->data; | ||
} else if (entry_point->entryData.function == | ||
RE::BGSEntryPointPerkEntry::EntryData::Function::kAddActorValueMult) { | ||
if (perk_entry->GetFunction() == RE::BGSPerkEntry::EntryPoint::kModPoisonDoseCount) { | ||
auto av = actor_->AsActorValueOwner()->GetActorValue(RE::ActorValue::kAlchemy); | ||
result_ += static_cast<float>(av * 0.1 * 3); | ||
} | ||
} | ||
logger::trace("Got value {} for Perk, total now is {}"sv, value->data, result_); | ||
} | ||
|
||
return ReturnType::kContinue; | ||
} | ||
|
||
float perk_visitor::get_result() const { return result_; } | ||
} // util |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#pragma once | ||
|
||
namespace util { | ||
class perk_visitor : public RE::PerkEntryVisitor { | ||
public: | ||
explicit perk_visitor(RE::Actor* a_actor, float a_base) { | ||
actor_ = a_actor; | ||
result_ = a_base; | ||
} | ||
|
||
ReturnType Visit(RE::BGSPerkEntry* perk_entry) override; | ||
|
||
[[nodiscard]] float get_result() const; | ||
|
||
protected: | ||
RE::Actor* actor_; | ||
float result_; | ||
}; | ||
} // util |