From 14ac6f5060d4454b7638b1a7e9839f0597ed91a5 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Thu, 16 Jan 2025 23:55:15 -0600 Subject: [PATCH] update Moved to citems from cbaseobjects sinc ethis can only be added to items. --- source/cBaseObject.cpp | 25 +------------------------ source/cBaseObject.h | 4 ---- source/cItem.cpp | 20 +++++++++++++++++++- source/cItem.h | 4 ++++ 4 files changed, 24 insertions(+), 29 deletions(-) diff --git a/source/cBaseObject.cpp b/source/cBaseObject.cpp index f9c8da3cc..506c247ac 100644 --- a/source/cBaseObject.cpp +++ b/source/cBaseObject.cpp @@ -94,7 +94,6 @@ const SI16 DEFBASE_KILLS = 0; const UI16 DEFBASE_RESIST = 0; const bool DEFBASE_NAMEREQUESTACTIVE = 0; const ExpansionRuleset DEFBASE_ORIGIN = ER_UO; -const SI16 DEFBASE_LOWERSTATREQ = 0; //o------------------------------------------------------------------------------------------------o //| Function - CBaseObject constructor @@ -111,8 +110,7 @@ loDamage( DEFBASE_LODAMAGE ), weight( DEFBASE_WEIGHT ), mana( DEFBASE_MANA ), stamina( DEFBASE_STAMINA ), scriptTrig( DEFBASE_SCPTRIG ), st2( DEFBASE_STR2 ), dx2( DEFBASE_DEX2 ), in2( DEFBASE_INT2 ), FilePosition( DEFBASE_FP ), poisoned( DEFBASE_POISONED ), carve( DEFBASE_CARVE ), oldLocX( 0 ), oldLocY( 0 ), oldLocZ( 0 ), oldTargLocX( 0 ), oldTargLocY( 0 ), -fame( DEFBASE_FAME ), karma( DEFBASE_KARMA ), kills( DEFBASE_KILLS ), subRegion( DEFBASE_SUBREGION ), nameRequestActive( DEFBASE_NAMEREQUESTACTIVE ), origin( DEFBASE_ORIGIN ), -lowerStatReq( DEFBASE_LOWERSTATREQ ) +fame( DEFBASE_FAME ), karma( DEFBASE_KARMA ), kills( DEFBASE_KILLS ), subRegion( DEFBASE_SUBREGION ), nameRequestActive( DEFBASE_NAMEREQUESTACTIVE ), origin( DEFBASE_ORIGIN ) { multis = nullptr; tempMulti = INVALIDSERIAL; @@ -1038,27 +1036,6 @@ void CBaseObject::IncHP( SI16 amtToChange ) SetHP( hitpoints + amtToChange ); } -//o------------------------------------------------------------------------------------------------o -//| Function - CBaseObject::GetLowerStatReq() -//| CBaseObject::GetLowerStatReq() -//| Date - 30 April, 2024 -//o------------------------------------------------------------------------------------------------o -//| Purpose - Gets/Sets the Stat Requirements of the object -//o------------------------------------------------------------------------------------------------o -SI16 CBaseObject::GetLowerStatReq( void ) const -{ - return lowerStatReq; -} -void CBaseObject::SetLowerStatReq( SI16 newValue ) -{ - lowerStatReq = newValue; - - if( CanBeObjType( OT_ITEM )) - { - ( static_cast( this ))->UpdateRegion(); - } -} - //o------------------------------------------------------------------------------------------------o //| Function - CBaseObject::GetDir() //| CBaseObject::SetDir() diff --git a/source/cBaseObject.h b/source/cBaseObject.h index 84c38ee70..638e826f7 100644 --- a/source/cBaseObject.h +++ b/source/cBaseObject.h @@ -69,7 +69,6 @@ class CBaseObject SI16 dexterity; SI16 intelligence; SI16 hitpoints; - SI16 lowerStatReq; VisibleTypes visible; SI16 hiDamage; SI16 loDamage; @@ -257,9 +256,6 @@ class CBaseObject void IncDexterity( SI16 toInc = 1 ); void IncIntelligence( SI16 toInc = 1 ); - virtual SI16 GetLowerStatReq( void ) const; - virtual void SetLowerStatReq( SI16 newValue ); - virtual void PostLoadProcessing( void ); virtual bool LoadRemnants( void ) = 0; diff --git a/source/cItem.cpp b/source/cItem.cpp index 2303fc7e1..7f12f11d2 100644 --- a/source/cItem.cpp +++ b/source/cItem.cpp @@ -94,6 +94,7 @@ const UI16 DEFITEM_REGIONNUM = 255; const UI16 DEFITEM_TEMPLASTTRADED = 0; const SI08 DEFITEM_STEALABLE = 1; const SI16 DEFITEM_ARTIFACTRARITY = 0; +const SI16 DEFITEM_LOWERSTATREQ = 0; //o------------------------------------------------------------------------------------------------o //| Function - CItem() @@ -108,7 +109,7 @@ spd( DEFITEM_SPEED ), maxHp( DEFITEM_MAXHP ), amount( DEFITEM_AMOUNT ), layer( DEFITEM_LAYER ), type( DEFITEM_TYPE ), offspell( DEFITEM_OFFSPELL ), entryMadeFrom( DEFITEM_ENTRYMADEFROM ), creator( DEFITEM_CREATOR ), gridLoc( DEFITEM_GRIDLOC ), weightMax( DEFITEM_WEIGHTMAX ), baseWeight( DEFITEM_BASEWEIGHT ), maxItems( DEFITEM_MAXITEMS ), maxRange( DEFITEM_MAXRANGE ), baseRange( DEFITEM_BASERANGE ), maxUses( DEFITEM_MAXUSES ), usesLeft( DEFITEM_USESLEFT ), regionNum( DEFITEM_REGIONNUM ), -tempLastTraded( DEFITEM_TEMPLASTTRADED ), stealable( DEFITEM_STEALABLE ), artifactRarity(DEFITEM_ARTIFACTRARITY) +tempLastTraded( DEFITEM_TEMPLASTTRADED ), stealable( DEFITEM_STEALABLE ), artifactRarity( DEFITEM_ARTIFACTRARITY ), lowerStatReq( DEFITEM_LOWERSTATREQ ) { spells[0] = spells[1] = spells[2] = 0; value[0] = value[1] = value[2] = 0; @@ -560,6 +561,23 @@ void CItem::SetArtifactRarity( SI16 newValue ) UpdateRegion(); } +//o------------------------------------------------------------------------------------------------o +//| Function - CItem::GetLowerStatReq() +//| CItem::GetLowerStatReq() +//| Date - 30 April, 2024 +//o------------------------------------------------------------------------------------------------o +//| Purpose - Gets/Sets the Stat Requirements of the object +//o------------------------------------------------------------------------------------------------o +SI16 CItem::GetLowerStatReq( void ) const +{ + return lowerStatReq; +} +void CItem::SetLowerStatReq( SI16 newValue ) +{ + lowerStatReq = newValue; + UpdateRegion(); +} + //o------------------------------------------------------------------------------------------------o //| Function - CItem::GetName2() //| CItem::SetName2() diff --git a/source/cItem.h b/source/cItem.h index 4b220999e..62c7cb13a 100644 --- a/source/cItem.h +++ b/source/cItem.h @@ -49,6 +49,7 @@ class CItem : public CBaseObject SERIAL creator; // Store the serial of the player made this item SI08 gridLoc; SI16 artifactRarity; + SI16 lowerStatReq; SI32 weightMax; // Maximum weight a container can hold SI32 baseWeight; // Base weight of item. Applied when item is created for the first time, based on weight. Primarily used to determine base weight of containers UI16 maxItems; // Maximum amount of items a container can hold @@ -114,6 +115,9 @@ class CItem : public CBaseObject virtual SI16 GetArtifactRarity(void) const; virtual void SetArtifactRarity(SI16 newValue); + SI16 GetLowerStatReq( void ) const; + void SetLowerStatReq( SI16 newValue ); + auto GetStealable() const -> UI08; auto SetStealable( UI08 newValue ) -> void;