Mirage Source

Free ORPG making software.
It is currently Tue Apr 16, 2024 2:36 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Item stat Bonuses?
PostPosted: Sat Aug 15, 2009 7:41 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: infectiousbyte@gmail.com
Okay, so I was adding in item stat bonuses, and I managed to get it to work. But I get this dirty feeling that I did it sloppy, so I'd appreciate it if some of you good fellows could give it a once over, and tell me how it looks, and how I could improve it, should it need improving. Here's an example:

Code:
            Case ITEM_TYPE_WEAPON

                If InvNum <> GetPlayerEquipmentSlot(Index, Weapon) Then
                    If GetPlayerStat(Index, Stats.Strength) < n Then
                        Call PlayerMsg(Index, "Your strength is to low to hold this weapon!  Required STR (" & n & ")", BrightRed)
                        Exit Sub
                    End If
                   
                    If Item(GetPlayerInvItemNum(Index, InvNum)).MPBonus > 0 Then
                        Call SetPlayerStat(Index, Magic, GetPlayerStat(Index, Magic) + Item(GetPlayerInvItemNum(Index, InvNum)).MPBonus)
                    End If
                   
                    Call SetPlayerEquipmentSlot(Index, InvNum, Weapon)
                   
                Else

                    If Item(GetPlayerInvItemNum(Index, InvNum)).MPBonus > 0 Then
                        Call SetPlayerStat(Index, Magic, GetPlayerStat(Index, Magic) - Item(GetPlayerInvItemNum(Index, InvNum)).MPBonus)
                    End If

                    Call SetPlayerEquipmentSlot(Index, 0, Weapon)
                End If

                Call SendWornEquipment(Index)

_________________
Image
GIAKEN wrote:
Since I'm into men, not women

GIAKEN wrote:
I can't take these huge penises anymore! All that's left is shame! And blood


Top
 Profile  
 
 Post subject: Re: Item stat Bonuses?
PostPosted: Sat Aug 15, 2009 7:46 pm 
Offline
Persistant Poster

Joined: Fri Jun 26, 2009 10:15 pm
Posts: 701
Google Talk: FAProductions
I would personally add temp variables for each of those. Then when each of those are checked, like in the functions with the formulas, I would add them together if there was a bonus. Instead of adding it like that. When I did it your way, some stuff would fuck up and I would end up with negative stats. Lol.

It's hard to kill things with -16 str..


Top
 Profile  
 
 Post subject: Re: Item stat Bonuses?
PostPosted: Sat Aug 15, 2009 7:53 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: infectiousbyte@gmail.com
Matt wrote:
I would personally add temp variables for each of those. Then when each of those are checked, like in the functions with the formulas, I would add them together if there was a bonus. Instead of adding it like that. When I did it your way, some stuff would fuck up and I would end up with negative stats. Lol.

It's hard to kill things with -16 str..


Yeah, very good point. Thanks, I'll go rewrite that.

_________________
Image
GIAKEN wrote:
Since I'm into men, not women

GIAKEN wrote:
I can't take these huge penises anymore! All that's left is shame! And blood


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group