hi
i was thinking of let the world know who win and who lost. i am going to try my best on my that proc and i will type it here. if i made a mistake please indicate what i made mistake and what its going to affect.
mob/Login()
src.wara = 0
src.warb = 0
src.warc = 0
mob/var/wara=0
mob/var/warb=0
mob/var/warc=0
mob/proc
guildwin()
if(src.warb == 0)
world <<"[src.guild] defeated [src.guild]
src.wara = 0
src.warc = 0
guildwin1()
if(src.wara == 0)
world <<"[src.guild] defeated [src.guild]
src.warb = 0
src.warc = 0
mob/verb
Finishoff()
set category = "fight"
for(var/mob/M in get_step(src,dir))
guildwin()
guildwin1()
if(usr.wara > 0)
usr.wara -= 1
if(M.warb > 0)
M.warb -= 1
and little change in my guild war code too.. because i added this new proc and other codes
mob
verb
Guild_War(mob/characters/M in world)
set category="Guild"
set name = "War"
if(src.warc == 1)
usr << "War arena in use"
if(usr.Inguild == 0)
usr << "Sorry, your not in a guild."
if(usr.ClanLeader == 0)
usr << "Your Not Leader Of This Guild"
else
switch(alert(src,"[usr] challenges your Guild to a fight. Do you accept the request?","Guild War","Yes","No"))
if("Yes")
world <<"[usr.guild]declared a war against [M.guild]."
if(M.guild == usr.guild)
alert("[src] accepted the Challenge","Accepted")
M.loc =locate(143,(rand(3,30)),3)
usr.loc =locate(143,(rand(3,30)),3)
usr.wara += 1
usr.warc = 1
if(M.guild == src.guild)
M.loc =locate(173,(rand(3,30)),3)
src.loc =locate(173,(rand(3,30)),3)
M.warb += 1
M.warc = 1
if("No")
alert(usr,"[M] declined the Challenge","Declined")
world <<"[M.guild]declined the war against [usr.guild]."
all this made by my imagination
thank you
- Dtroys
ID:173949
Oct 22 2003, 10:47 am
|
|
In response to Dracon_o
|
|
It is not perfect code, and his indentation is just fine.
I do see a problem, you have "[src.guild] defeated [src.guild]" in there, and that will produce the same guild name twice. You need a variable that keeps track of the guild that the player is warring against, something like: mob/var/enemy_guild Then change that text string to "[src.guild] defeated [enemy_guild]" |
Unknown