if(src.race == "C1P2Story")//This is a death code for one of my story mode bosses
if(usr:ally)//In some parts of the story you will have allies, this part of the code handles if they have the last strike
for(var/mob/characters/Ally in world)
if(Ally == usr.ally)
if(!src.boss&&!src.boss2&&!src.boss3&&!src.bijuuboss)
var/gain = round(src.maxpowerlevel / 337)
if(Ally.maxpowerlevel >= (src.maxpowerlevel / 10))
Ally.maxpowerlevel += gain
Ally.zenni += src.givezenni * 2
Ally.maxpowerlevel = round(Ally.maxpowerlevel)
Ally << "<b>You gained [src.givezenni * 2] zenni and your power increased [gain] from that kill!"
else
Ally << "<b>You gained [src.givezenni * 2] zenni from that kill"
if(src.alignment == "Evil")
Ally.karma += src.karmagive
if(src.alignment == "Good")
Ally.karma -= src.karmagive
Chapter2(Ally) //This send the Ally of the npc, which should be you the player, to the chapter 2 proc
else if(usr:owner)//The game also features pets, this part of the code handles if your pet lands the last strike
for(var/mob/characters/Own in world)
if(Own == usr.owner)
if(!src.boss&&!src.boss2&&!src.boss3&&!src.bijuuboss)
var/gain = round(src.maxpowerlevel / 337)
//var/
if(Own.maxpowerlevel >= (src.maxpowerlevel / 10))
Own.maxpowerlevel += gain
Own.zenni += src.givezenni * 2
Own.maxpowerlevel = round(Own.maxpowerlevel)
Own << "<b>You gained [src.givezenni * 2] zenni and your power increased [gain] from that kill!"
else
Own << "<b>You gained [src.givezenni * 2] zenni from that kill"
if(src.alignment == "Evil")
Own.karma += src.karmagive
if(src.alignment == "Good")
Own.karma -= src.karmagive
Chapter2(Own) //This send the pet owner, which should be you the player, to the chapter 2 proc
else if(!usr:owner&&!usr:ally)//This handles if you deliver the last strike, not much here as it follows a generic kill code
Chapter2(usr) //This sends you the player to the chapter 2 proc
Chapter2(mob/M)
src.loc=locate(1,1,11) //I decided to send the src which should be the boss to a void point until the proc does what it needs, after which the generic kill code will delete it
M.c1p2 = 1 //The player should now have 1 in this variable showing they have completed the chapter
switch(input(M,"Do you wish to continue?" , "Story Mode", text) in list ("Yes","No")) //They should then be given an option to continue
if("Yes")//If so they go on through the story
for (var/mob/S in world)
if(S.ally == M)
del(S)
M.loc=locate(23,92,17)
M.dir = 1
var/mob/U = new /mob/monsters/Ally/SYamcha
U.loc=locate(22,92,17)
U.dir=1
U.ally = M
var/mob/U2 = new /mob/monsters/Ally/STien
U2.loc=locate(24,92,17)
U2.dir=1
U2.ally = M
M << "<b>Defeat 20 saibamen!"
return..()
else if("No")// If not they are returned to the storymode npc
for (var/mob/S in world)
if(S.ally == M)
del(S)
M.loc=locate(100,84,11)
return..()
return..()
Problem description:
The proc runs as it should maybe 3 times after which the switch popup asking you to continue does not popup. I'm figuring that the chapter2 proc is not reporting back to the deathcode to let it know it finished, so it won't open a new one.
The first few times you kill the boss, it ask if you want to continue if you do you move on, if not it takes you to a safe zone basically
After 3 or so times instead it'll move the boss to the void point 1,1,11, but won't continue to the switch input
https://youtu.be/_pr767ZT5dU