Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Moved to citems from cbaseobjects sinc ethis can only be added to items.
  • Loading branch information
DragonSlayer62 committed Jan 17, 2025
1 parent 8ad410f commit 14ac6f5
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 29 deletions.
25 changes: 1 addition & 24 deletions source/cBaseObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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<CItem *>( this ))->UpdateRegion();
}
}

//o------------------------------------------------------------------------------------------------o
//| Function - CBaseObject::GetDir()
//| CBaseObject::SetDir()
Expand Down
4 changes: 0 additions & 4 deletions source/cBaseObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class CBaseObject
SI16 dexterity;
SI16 intelligence;
SI16 hitpoints;
SI16 lowerStatReq;
VisibleTypes visible;
SI16 hiDamage;
SI16 loDamage;
Expand Down Expand Up @@ -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;

Expand Down
20 changes: 19 additions & 1 deletion source/cItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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;
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 4 additions & 0 deletions source/cItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 14ac6f5

Please sign in to comment.