Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

Tredecim Scythe #6424

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Tredecim Scythe #6424

wants to merge 3 commits into from

Conversation

Caelic
Copy link
Contributor

@Caelic Caelic commented Apr 12, 2020

the 13th hit guaranteed critical is not coded yet so here it is. wiki says it shouldnt count WS hits and this code follows that, this is just for autoattacks. wiki says it should save hit count when zoning but that will require adding an extra field within the database and i didn't want to clutter the database more to add "cross-zone memory" just seems unimportant. upon zoning the count is just set to 0.

Copy link
Contributor

@zach2good zach2good left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting find! If you need an example of how to transition this from hard-coded items into mods, I had to do exactly the same thing a while ago here:
https://github.com/DarkstarProject/darkstar/pull/5866/files

@@ -1426,6 +1426,12 @@ bool CBattleEntity::OnAttack(CAttackState& state, action_t& action)
actionList_t& list = action.getNewActionList();

list.ActionTargetID = PTarget->id;

bool tredecim = false;
if (this->objtype == TYPE_PC && (((CCharEntity*)this)->getEquip(SLOT_MAIN))->getID() == 18052)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not good to hard code specific item IDs in the core, it would be much better to handle this with an item mod

@@ -1514,7 +1523,11 @@ bool CBattleEntity::OnAttack(CAttackState& state, action_t& action)
{
// Set this attack's critical flag.
attack.SetCritical(dsprand::GetRandomNumber(100) < battleutils::GetCritHitRate(this, PTarget, !attack.IsFirstSwing()));

if (tredecim && ((CCharEntity*)this)->m_hitCounter > 12)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the mod was CRIT_ON_HIT_X, you could do:

if (hasMod(CRIT_ON_HIT_X))
    (((CCharEntity*)this)->m_hitCounter)++;

...

if (hasMod(CRIT_ON_HIT_X) && counter % modValue == 0)
    ((CCharEntity*)this)->m_hitCounter = 0;
	 attack.SetCritical(true);

@Caelic
Copy link
Contributor Author

Caelic commented Apr 12, 2020

this is the only item in the game that tracks x hits. if you want to generalize it then you have to set up a memory system so that every item with the mod will remember its own hit counter and not interfere with another item's hit counter. it's an unnecessary amount of work to generalize it if it's the only item that will ever use the latent.

@zach2good
Copy link
Contributor

I wonder if it's worth adding a new member to CCharEntity when only the population that equips the scythe at least once will ever need it, there's nothing else as item-specific in CCharEntity. As much as forever-CharVars are frowned upon, they could be another option to track the hit counter.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants