ID:158693
 
Hi, i need to find out how to make a card fighting system. I got the challenge verb here.
mob
verb
Challenge(var/mob/M in world)
if(M.AlreadyFighting == 0)
switch(input(M,"[usr] ([Level]) wants to fight you!","Challenge", text) in list ("Yes","No"))
if("Yes")
M.loc = locate(usr.x,usr.y+5,z)
M.dir = SOUTH
usr.dir = NORTH
Champion = M
Fight()
if("No")
usr << "Sorry, [M] didn't want to fight."

Which requests for a challenge.

I'm now trying to figure out a fighting system that is similar to urban rivals. For those who don't play urban rival system is this.

1. Player chooses one of their cards. Their opponent do the same after the first player chooses theirs.

2. Before playing their cards they can give their cards Pillz which makes them stronger. Each pillz add onto their attack. One pill = their power x 2. 4 pills = their power plus power x 4.

3. The cards effects (if any take place) some effects are poison, stop opp ability, etc. If their attack is more than 12 of their opponents attack, they knock them out with one hit. If its less it does a random until the card health is gone (Usually its the strongest card that wins.)

3. Card damages the person fighting life points.

4. This goes on until all cards are used (4 cards) or one of the players life points equals to zero.

I really need this system for my game as its really important.
Requests to make your game for you, Gamemakingdude, will go wholly ignored except to the degree required to appreciate the irony involved.
In response to Garthor
Garthor wrote:
Requests to make your game for you, Gamemakingdude, will go wholly ignored except to the degree required to appreciate the irony involved.

There's more too the game than the fighting system i have to get everything else programmed.
In response to Gamemakingdude
No, sorry, I'm not going to work for free just because you're "too busy."
In response to Garthor
Garthor wrote:
No, sorry, I'm not going to work for free just because you're "too busy."

Ok, i don't know how to start it then. Can someone give me the start of the code and ill program the rest. Cos im unsure how to do it.
In response to Gamemakingdude
Trial & Error
In response to Gamemakingdude
Gamemakingdude wrote:
Can someone give me the start of the code and ill program the rest.

You could've asked for a break-down, explanation or design ideas, but okay. We'd need more info to go in-depth in those, anyway, so sure, here's the start of The Code!!!
obj/card
icon = 'cardz.dmi'
var/mob/player/owner
var/pillz
proc/ModifyPillz(p)
src.pillz = max(0,src.pillz+p)
proc
Effect()
creature
var
health
strength
proc/ModifyHealth(h)
DisplayNumber(h,x,y,z)
src.health += h
if(src.health <= 0)
src.Defeated()
proc/Attack(obj/card/creature/opponent)
var/dmg = src.strength - opponent.strength
opponent.ModifyHealth(dmg)
proc/Defeated()
del src
mob/player
var/list/cards
verb/Challange(mob/M as null|anything in PlayerMobs())
if(M)
M << "[src] challanges joo!"
proc/PlayersMobs()
. = list()
for(var/client/C) if(C.mob) . += C.mob

Good luck! <code><font color=#003399><small>wonder how long it'll take for him to copy this then fail and post back whining</small></font></code>
In response to Kaioken
Kiaoken, i have a card system.
obj/cards
layer=MOB_LAYER+10
icon='cards.dmi'
var/mob/owner
var
inhand=1
Dale
icon_state="Dale"
CardName = "Dale"
Omar
icon_state="Omar"
CardName = "Omar"
Alexei
icon = 'Alexei.dmi'
CardName = "Alexei"
icon_state = "Alexei_1"
pixel_y = 32
Damage = 2
Power = 2
Ability = "Stop Opp Ability"
Bonus = ""

MouseEntered()
usr.StatCardName = src.CardName
usr.StatPower = src.Power
usr.StatDamage = src.Damage
usr.StatAbility = src.Ability
usr.StatBonus = src.Bonus
MouseExited()
usr.StatCardName = ""
usr.StatPower = ""
usr.StatDamage = ""
usr.StatAbility = ""
usr.StatBonus = ""

Click()
if(usr.AlreadyFighting) return
if(usr==src.owner)
if(src.inhand)
if(usr.cardsonfield>4)return
switch(alert("Do you wish to play [src]?","[src]","Yes","No"))
if("No")return
src.inhand=0
usr.client.screen-=src
src.loc=locate(usr.x+usr.cardsonfield,usr.y+2,usr.z)
usr.cardsonfield++
else
return
else
alert("No Touching, Its not Your Card!")
return


but i would like to make to make it in a spearate proc.
In response to Gamemakingdude
Gamemakingdude wrote:
Kiaoken, i have a card system.

Ah. Don't want to break it to you, but you don't really. >_>
You do have some nice cards with... icons, and stuff, though!

but i would like to make to make it in a spearate proc.

What are you referring to by "it"? But let me give you a hand.
proc/SpearateProc()
world << "This is a separate proc!"

Or, maybe you'd even want an ebject proc!
mob/player
proc/Challenge(mob/player/P)
In response to Kaioken
mob
verb
Challenge(var/mob/M in world)
if(M.AlreadyFighting == 0)
switch(input(M,"[usr] ([Level]) wants to fight you!","Challenge", text) in list ("Yes","No"))
if("Yes")
M.loc = locate(usr.x,usr.y+5,z)
M.dir = SOUTH
usr.dir = NORTH
Champion = M
Fight()
if("No")
usr << "Sorry, [M] didn't want to fight."
proc
Fight()
world << "[Champion] and [usr] are in a fight!"
for(Life > 12)
if(usr.Turn == 0)
usr.Turn = 1


This is what i meant by a separate proc. It only has to call one proc when its fighting.

PS. I just saw Kiaoken's hidden message. I'm not copying it since it's hard for me to understand. If you could comment it then it would be good.
In response to Gamemakingdude
Quote @ Kiaoken: wonder how long it'll take for him to copy this then fail and post back whining <---- How childish of you to flame him in secret... That is by no means a righteous way to help someone.