Mirage Source

Free ORPG making software.
It is currently Mon Jun 03, 2024 4:02 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Battle system
PostPosted: Thu Apr 02, 2009 2:46 pm 
Offline
Knowledgeable
User avatar

Joined: Fri Feb 02, 2007 4:50 am
Posts: 263
Location: usa michigan centriville
well the battle system and leveling system are a bit flawed in my understanding, it goes threw this giant loop with all of these different functions for both players and npc based on what they attack

OK lets start here

Public Sub AttackNpc

we got 11 dims for one we could decrease that by using 1 dim for more things rather than just one =.=.

check sub out of range looks ok.

Code:
MapNum = GetPlayerMap(Attacker)
    NpcNum = MapNpc(MapNum, MapNpcNum).Num
    Name = Trim$(Npc(NpcNum).Name)
   
    ' Send this packet so they can see the person attacking
    Call SendDataToMapBut(Attacker, MapNum, SAttack & SEP_CHAR & Attacker & END_CHAR)


Ok so here in ms4 we are just showing that the person is attacking fter it goes threw senddatatomapbut and determines it is a person or npc attacking .... Why would we have to set the player attacking animation here. and beside it shows the animation to soon. i can attack it shows the animation then have to wait for more than half of the attack sub to complete before the npc dies and respawns. slow

' Check for weapon is fine but we should make a private sub for it.

The party stuff could be redone and recalculated for better performance.

and we are setting the npc as dead before actually determining they are dead.

Then we call CheckPlayerLevelUp which should be a private sub.

' Check for level up
Call CheckPlayerLevelUp(Attacker)

' Check for level up party member
If TempPlayer(Attacker).InParty = YES Then
Call CheckPlayerLevelUp(TempPlayer(Attacker).PartyPlayer)
End If

We should check if there in a party first before checking if they leveled up.

then check to see if the npc is dead

' Check if target is npc that died and if so set target to 0
If TempPlayer(Attacker).TargetType = TARGET_TYPE_NPC Then
If TempPlayer(Attacker).Target = MapNpcNum Then
TempPlayer(Attacker).Target = 0
TempPlayer(Attacker).TargetType = TARGET_TYPE_NONE
End If
End If
Else

and if not dead we just do the damage.

Then we check for a weapon a second time.

then it checks to see if the npc has something to say to you after you attack it.

then it sets the target if the npc is still alive

then check for if its a guard AI

the does these
' Reduce durability of weapon
Call DamageEquipment(Attacker, Weapon)

' Reset attack timer
TempPlayer(Attacker).AttackTimer = GetTickCount. Why do we have to check things more than once.and why are we checking for things at the wrong time.

it should go

1 Sub attacknpc
2 Subscript
3 MapNum = GetPlayerMap(Attacker)
NpcNum = MapNpc(MapNum, MapNpcNum).Num
Name = Trim$(Npc(NpcNum).Name)
4 ' Check for weapon
5 calculate the damage to the npc vital
6 determine if we killed it or not
7 say if you killed the npc or not and how much damage you did.
8 Do the animation
9 determine if they are a guard AI
10 items droped
11 Calculate the EXP gained
12 levels
13 damage weapon if you have any
14 reset timer

much shorter and faster this way.

the other way uses like 20 steps.

pretty much the same for Sub AttackPlayer

_________________
Fuck? I really joined in 2006.
Spirea, Chat Rooms, Discussions, Help. everything you need in one spot.
http://spirean.com
I love my computer, you never ask for more, you can be my princess or be my whore


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 guests


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