# The Death of Duke Von Stabbingmore # 2012 1-Week Collaberation Contest Game # Team: James Paige and Sid Tyler include, plotscr.hsd include, scancode.hsi include, vonstabbingmore.hsi ######################################################################## script, assert failure, begin show text box(2) wait for text box end define constant(1, assert expression string) ######################################################################## plotscript, map autorun, begin # Tall walkabout support is based on the walktall.hss script embiggen walkabouts end plotscript, donothing, begin # for cancelling a text box in the instead-conditional end ######################################################################## plotscript, intro, begin variable(flor, father, duke) flor := rank in caterpillar(hero:Florette) father := NPC reference(8) duke := NPC reference(0) suspend player wait(5) set NPC speed(duke, 4) walk NPC(duke, south, 2) wait for NPC(duke) show text box(21) # Duke Aaldrick Von Stabbingmore anounces self suspend NPCs focus camera(NPC X(duke), NPC Y(duke), 5) wait for camera wait for text box if(key is pressed(key:x)) then( #Skip intro for quick debugging resume player resume NPCs camera follows hero(flor) exit script ) set NPC direction(duke, west) wait(4) set NPC direction(duke, south) wait(4) set NPC direction(duke, east) wait(4) set NPC direction(duke, south) wait(4) show text box(22) # demands taxes wait for text box focus camera(NPC X(father), NPC Y(father), 5) wait for camera wait(3) set hero direction(flor, east) set NPC direction(father, west) wait(2) set hero direction(flor, north) set NPC direction(father, north) wait(8) set hero direction(flor, east) set NPC direction(father, west) wait(2) show text box(23) # I must have words with the Duke! jiggle NPC(father, 8) wait for text box show text box(24) # be careful Father! jiggle hero(flor, 8) wait for text box set NPC speed(father, 4) walk NPC(father, north, 4) focus camera(hero X(flor), hero Y(flor), 5) wait for camera camera follows hero(flor) wait for NPC(father) suspend obstruction walk NPC(father, north, 1) walk NPC(father, east, 1) walk NPC(duke, west, 1) set NPC direction(duke, east) set hero speed(flor, 2) walk hero(flor, north, 1) wait for NPC(duke) wait for NPC(father) set NPC direction(father, west) wait for hero(flor) set hero speed(flor, 4) focus camera(hero X(flor), hero Y(flor) -- 1, 4) wait for camera wait(5) show text box(25) # Do you want us to starve? jiggle NPC(father, 8) wait for text box wait(5) show text box(26) # Your lives mean nothing! jiggle NPC(duke, 8) wait for text box wait(5) show text box(27) # You have no right to treat us this way! jiggle NPC(father, 8) wait for text box wait(5) show text box(28) # Methinks an example must be made jiggle NPC(duke, 8) wait for text box duke draws sword wait(5) set NPC speed(duke, 10) walk NPC(duke, east, 1) wait for NPC(duke) change tall NPC(father, 12) show text box(29) # FATHER! change tall walkabout(hero:Florette, 0, 5) jiggle hero(flor, 6) wait for text box set NPC speed(duke, 4) walk NPC(duke, west, 1) set NPC direction(duke, east) wait for NPC wait(5) duke sheaths sword advance text box change tall walkabout(hero:Florette, 1) set hero speed(flor, 10) walk hero(flor, north, 3) walk hero(flor, east, 3) wait for hero(flor) walk hero to Y(flor, NPC Y(father)) wait for hero(flor) set hero direction(flor, west) wait(2) change tall walkabout(hero:Florette, 13) set hero speed(flor, 5) set NPC speed(father, 5) walk hero(flor, south, 1) walk NPC(father, south, 1) wait for hero(flor) set NPC direction(duke, south) set hero speed(flor, 4) set NPC speed(father, 4) walk hero(flor, south, 1) walk NPC(father, south, 1) wait for hero(flor) focus camera(hero x(flor), 21, 3) set hero speed(flor, 2) set NPC speed(father, 2) walk hero to Y(flor, 21) walk NPC to Y(father, 21) wait for hero(flor) wait for NPC(father) set NPC direction(father, east) show text box(30) # My wound is dire, let me sit by yonder tree jiggle NPC(father, 6) wait for text box change tall walkabout(hero:Florette, 1) set hero speed(flor, 10) walk hero(flor, north, 1) walk hero(flor, west, 1) wait for hero(flor) walk hero(flor, south, 1) walk hero(flor, west, 1) wait for hero(flor) wait for camera change tall walkabout(hero:Florette, 13) set hero speed(flor, 2) walk hero to X(flor, 25) walk NPC to X(father, 26) wait(20) camera follows hero(flor) wait for hero(flor) wait for NPC(father) set NPC direction(father, west) wait(2) change tall NPC(father, 14) wait(2) change tall walkabout(hero:Florette, 1) show text box(31) # Will you be allright? jiggle hero but not camera(flor, 8) wait for text box wait(5) show text box(32) # ...I fear the worst jiggle NPC(father, 8) wait for text box wait(5) show text box(33) jiggle hero but not camera(flor, 8) wait for text box focus camera(NPC X(duke), NPC Y(duke), 10) wait for camera set NPC direction(duke, east) wait(5) set NPC direction(duke, north) wait(5) set NPC direction(duke, west) wait(5) set NPC direction(duke, south) wait(5) show text box(34) jiggle NPC(duke, 6) wait for text box show text box(35) jiggle NPC(duke, 6) wait for text box resume obstruction resume NPCs set NPC frame(duke, 0) focus camera(hero X(flor), hero Y(flor), 10) wait for camera camera follows hero(flor) set hero speed(flor, 4) walk hero(flor, west, 1) set hero direction(flor, east) wait for hero(flor) set hero direction(flor, south) wait(2) set hero direction(flor, west) wait(2) # shake fist change tall walkabout(hero:Florette, 0, 2) show text box(36) # Somehow I shall have vengeance! wait(5) jiggle hero but not camera(flor, 18) wait for text box change tall walkabout(hero:Florette, 1) resume player end script, jiggle NPC, ref, ticks, begin variable(x, y, i) x := NPC pixel X(ref) y := NPC pixel Y(ref) for(i, 1, ticks) do( put NPC(ref, x, y -- (i ,mod, 2)) wait(1) ) put NPC(ref, x, y) end script, jiggle hero, rank, ticks, begin variable(x, y, i) x := hero pixel X(rank) y := hero pixel Y(rank) for(i, 1, ticks) do( put hero(rank, x, y -- (i ,mod, 2)) wait(1) ) put hero(rank, x, y) end script, jiggle hero but not camera, rank, ticks, begin put camera(camera pixel X, camera pixel Y) jiggle hero(rank, ticks) camera follows hero(rank) end plotscript, back into town, begin variable(flor) flor := rank in caterpillar(hero:Florette) show text box(62) jiggle hero but not camera(flor, 8) wait for text box walk hero(flor, north, 2) end ######################################################################## plotscript, first battle, begin fight formation(0) restore health if(check tag(tag:Win first battle)) then( won first battle )else( lost first battle ) end script, won first battle, begin variable(duke) suspend player duke := NPC reference(0) change tall NPC(duke, 7) wait(4) set NPC speed(duke, 4) back NPC off(duke, 1) show text box(8) wait for text box if(NPC y(duke) >> hero y(rank in caterpillar(hero:Florette))) then( walk NPC(duke, east, 1) wait for NPC(duke) ) walk NPC to Y(duke, 10) wait for NPC(duke) walk NPC(duke, north, 4) wait for NPC(duke) set tag(3, ON) embiggen walkabouts resume player end script, lost first battle, begin suspend player show peasant girl weak frame(18) back hero off(me, 1) resume player end plotscript, handful of tomatos, begin get item(item:Tomato, 3) while(inventory(item:Tomato) >> 12) do( delete item(item:Tomato, 1) ) end plotscript, one single potato, begin if(check tag(tag:Win first battle)) then( # already used potato show text box(10) )else( if(inventory(item:Potato) >= 1) then( show text box(7) )else( show text box(6) get item(item:Potato, 1) ) ) wait for text box end script, restore health, begin variable(hero) hero := find hero(hero:Florette) set hero stat(hero, stat:HP, get hero stat(hero, stat:HP, maximum stat)) end ######################################################################## plotscript, second battle, begin update insults fight formation(1) restore health if(check tag(tag:duel challenged)) then( prepare for duel ) end script, update insults, begin variable(slot) slot := find hero(hero:Florette) teach spell(slot, atk:Plead) if(check tag(tag:Learned Smelly)) then(teach spell(slot, atk:Smelly)) if(check tag(tag:Learned Stupid)) then(teach spell(slot, atk:Stupid)) if(check tag(tag:Learned Coward)) then(teach spell(slot, atk:Coward)) if(check tag(tag:Learned Greedy)) then(teach spell(slot, atk:Greedy)) if(check tag(tag:Learned Lie)) then(teach spell(slot, atk:Lie)) if(check tag(tag:Learned Namecall)) then(teach spell(slot, atk:Namecall)) end plotscript, show rhetoric menu, begin update insults spells menu(find hero(hero:Florette)) end ######################################################################## script, prepare for duel, begin variable(duke, flor) suspend player duke := NPC reference(9) flor := rank in caterpillar(hero:Florette) embiggen walkabouts walk hero(flor, south, 2) set hero direction(flor, north) set NPC ignores walls(duke, true) set NPC speed(duke, 2) walk NPC(duke, south, 1) wait for NPC(duke) set NPC speed(duke, 4) set NPC ignores walls(duke, false) show text box(45) # A duel! jiggle NPC(duke, 8) wait for text box wait for hero(flor) wait(5) show text box(46) # You choose weapon jiggle NPC(duke, 8) wait for text box wait(5) show text box(47) # You don't even have any weapons jiggle NPC(duke, 8) wait for text box wait(5) show text box(48) # You can borrow mine jiggle NPC(duke, 8) wait for text box wait(5) show text box(49) # get sword wait for text box show text box(50) # get pistol wait for text box resume player end plotscript, third battle, begin suspend player forget insults set up duel stuff fight formation(2) restore health forget duel stuff if(check tag(tag:got revenge)) then( ending sequence )else( lost duel ) resume player end script, lost duel, begin variable(duke, flor) suspend player duke := NPC reference(9) flor := rank in caterpillar(hero:Florette) show peasant girl weak frame(18) back hero off(flor, 1) wait for hero(flor) set tag(tag:duke is disarmed, OFF) if(check tag(tag:already threw pistol)) then( show text box(58) wait for text box ) show text box(51) jiggle NPC(duke, 8) wait for text box change tall walkabout(hero:Florette, 0, 2) jiggle hero but not camera(flor, 8) show text box(52) jiggle hero but not camera(flor, 8) wait for text box change tall walkabout(hero:Florette, 1) set hero direction(flor, west) resume player end script, set up duel stuff, begin variable(slot) slot := find hero(hero:Florette) teach spell(slot, 69) # sword teach spell(slot, 71) # pistol teach spell(slot, 74) # grab end script, forget duel stuff, begin variable(slot) slot := find hero(hero:Florette) forget spell(slot, 69) # sword forget spell(slot, 71) # pistol forget spell(slot, 74) # grab end script, forget insults, begin variable(slot) slot := find hero(hero:Florette) forget spell(slot, atk:Plead) forget spell(slot, atk:Smelly) forget spell(slot, atk:Stupid) forget spell(slot, atk:Coward) forget spell(slot, atk:Greedy) forget spell(slot, atk:Lie) forget spell(slot, atk:Namecall) end plotscript, fathers advice, begin variable(flor, father) suspend player flor := rank in caterpillar(hero:Florette) father := NPC reference(8) show text box(53) # are you alive jiggle hero but not camera(flor, 8) wait for text box wait(5) show text box(54) # yes, for now jiggle NPC(father, 8) wait for text box wait(5) show text box(55) # how do I win the duel? jiggle hero but not camera(flor, 8) wait for text box wait(5) show text box(56) # the duke is not honorable, cheat! jiggle NPC(father, 8) wait for text box show text box(57) # cheat and get his sword! jiggle NPC(father, 8) wait for text box wait(5) resume player end ######################################################################## script, ending sequence, begin variable(flor, father) flor := rank in caterpillar(hero:Florette) suspend player suspend NPCs set hero position(flor, 17, 8) show duke death frame set hero speed(flor, 1) walk hero(flor, south, 1) set hero direction(flor, north) wait for hero(flor) walk hero(flor, east, 2) wait for hero(flor) set hero direction(flor, west) show text box(65) jiggle hero but not camera(flor, 8) wait for text box set hero speed(flor, 2) walk hero(flor, south, 1) wait for hero(flor) wait(4) set hero direction(flor, west) wait(4) set hero direction(flor, south) wait(4) set hero direction(flor, east) wait(4) set hero direction(flor, south) wait(4) show text box(66) jiggle hero but not camera(flor, 8) wait for text box walk hero(flor, south, 1) wait for hero(flor) wait(4) show text box(67) change tall walkabout(hero:Florette, 0, 6) wait(2) jiggle hero but not camera(flor, 8) wait for text box change tall walkabout(hero:Florette, 1) set hero direction(flor, west) wait(18) pan camera(south, 40, 1) walk hero(flor, south, 6) wait(40) fade screen out wait(1) camera follows hero(flor) set hero speed(flor, 4) teleport to map(3, 26, 21) wait(1) put camera(camera pixel X, camera pixel Y) set hero position(flor, 19, 30) wait(2) fade screen in roll credits wait(18) play song(song:Thunders) father := create NPC(8, 19, 31) embiggen walkabouts set hero speed(flor, 2) walk hero to Y(flor, 21) wait for hero(flor) wait(6) set hero direction(flor, east) wait(16) walk hero to X(flor, 26) wait for hero(flor) camera follows hero(flor) wait(8) change tall walkabout(hero:Florette, 13, 2) wait(16) change tall walkabout(hero:Florette, 1) set hero direction(flor, east) wait(4) set hero direction(flor, south) wait(4) set hero direction(flor, west) wait(4) change tall walkabout(hero:Florette, 0, 4) show text box(68) jiggle hero but not camera(flor, 8) wait for text box change tall walkabout(hero:Florette, 1) set hero direction(flor, west) walk NPC to Y(father, 21) wait for NPC(father) walk NPC(father, east, 1) wait for NPC(father) show text box(69) jiggle NPC(father, 8) wait for text box wait(4) show text box(70) jiggle NPC(father, 8) wait for text box show text box(71) jiggle hero but not camera(flor, 8) wait for text box show text box(72) jiggle NPC(father, 8) wait for text box walk NPC(father, west, 1) walk NPC(father, north, 1) wait for NPC(father) walk NPC to Y(father, 6) wait for NPC(father) walk NPC(father, west, 1) walk hero(flor, west, 2) wait for hero(flor) wait(4) set hero direction(flor, south) wait(4) show text box(73) jiggle hero but not camera(flor, 8) wait for text box wait(5) show text box(74) jiggle hero but not camera(flor, 8) wait for text box set hero speed(flor, 4) walk hero to X(flor, 19) walk hero to Y(flor, 16) wait for hero(flor) walk hero to Y(flor, 6) wait for hero(flor) suspend obstruction suspend hero walls suspend NPC walls walk hero(flor, north, 1) walk NPC(father, north, 1) walk NPC(father, east, 1) wait for hero(flor) put camera(camera pixel X, camera pixel Y) destroy NPC(father) set hero position(flor, 0, 0) roll back credits wait for key(any key) fade screen out wait(1) game over end script, roll credits, begin variable(col, sl, dist) col := load slice collection(0) sl := lookup slice(sli:credits) set slice y(sl, 200) dist := slice height(sl) + 200 move slice by(sl, 0, -1 * dist, dist * 2) wait for slice(sl) end script, roll back credits, begin variable(sl) sl := lookup slice(sli:credits) move slice by(sl, 0, 40, 40) wait for slice(sl) end ######################################################################## script, show peasant girl weak frame, ticks, begin variable(d) d := get hero direction by id(hero:Florette) suspend player change tall walkabout(hero:Florette, 0, 6) wait(ticks) change tall walkabout(hero:Florette, 1) set hero direction by id(hero:Florette, d) resume player end script, duke draws sword, begin variable(duke, sl, pic sl, big pic) duke := NPC reference(0) sl := get NPC slice(duke) pic sl := lookup slice(sl:walkabout sprite component, sl) set slice visible(pic sl, false) big pic := load medium enemy sprite(1) set slice lookup(big pic, sli:duke with sword) set parent(big pic, sl) set slice x(big pic, -10) set slice y(big pic, -30) end script, duke sheaths sword, begin variable(duke, sl, pic sl, big pic) duke := NPC reference(0) sl := get NPC slice(duke) pic sl := lookup slice(sl:walkabout sprite component, sl) set slice visible(pic sl, true) big pic := lookup slice(sli:duke with sword, sl) free slice(big pic), big pic := none end script, show duke death frame, begin variable(duke, sl, pic sl, big pic) duke := NPC reference(9) sl := get NPC slice(duke) pic sl := lookup slice(sl:walkabout sprite component, sl) set slice visible(pic sl, false) big pic := load medium enemy sprite(11) set parent(big pic, sl) set slice x(big pic, -10) set slice y(big pic, -30) end ######################################################################## script, walk hero away, rank, steps, begin variable(d) d := hero direction(rank) walk hero(rank, (d + 2) ,mod, 2, steps) wait for hero(rank) end script, back hero off, rank, steps, begin variable(d, b) d := hero direction(rank) b := (d + 2) ,mod, 4 walk hero(rank, b, steps) set hero direction(rank, d) wait for hero(rank) end script, walk NPC away, ref, steps, begin variable(d) d := NPC direction(ref) walk NPC(ref, (d + 2) ,mod, 2, steps) wait for NPC(ref) end script, back NPC off, ref, steps, begin variable(d) d := NPC direction(ref) walk NPC(ref, (d + 2) ,mod, 2, steps) set NPC direction(ref, d) wait for NPC(ref) end ######################################################################## script, get hero direction by id, id, begin variable(rank) rank := rank in caterpillar(id) assert(rank >= 0) exit returning(hero direction(rank)) end script, set hero direction by id, id, d, begin variable(rank) rank := rank in caterpillar(id) assert(rank >= 0) set hero direction(rank, d) end ######################################################################## script, embiggen walkabouts, begin embiggen heroes embiggen NPCs end script, embiggen heroes, begin variable(rank) for(rank, 0, 3) do( embiggen a hero(rank) ) end script, embiggen a hero, hero rank, begin variable(sl) if(hero by rank(hero rank) >= 0) then( # hero exists sl := get hero slice(hero rank) embiggen walkabout slice(sl) ) end script, embiggen NPCs, begin variable(npc) for(npc, -1, -300, -1) do( embiggen an NPC(npc) ) end script, embiggen an NPC, npc, begin variable(sl) if(get NPC id(npc) >= 0) then( # this NPC exists sl := get NPC slice(npc) embiggen walkabout slice(sl) ) end script, embiggen walkabout slice, sl, begin variable(pic sl, pic num) if(sl) then( pic sl := lookup slice(sl:walkabout sprite component, sl) pic num := get sprite set number(pic sl) replace hero sprite(pic sl, pic num) ) end script, set tall walkabout slice, sl, pic num, begin variable(pic sl) assert(sl <> 0) pic sl := lookup slice(sl:walkabout sprite component, sl) replace hero sprite(pic sl, pic num) end script, change tall walkabout, id, set, frame=-1, begin variable(rank, sl) rank := rank in caterpillar(id) assert(rank >= 0) sl := get hero slice(rank) set tall walkabout slice(sl, set) if(frame >= 0) then( set hero direction(rank, frame / 2) set hero frame(rank, frame ,mod, 2) ) end script, change tall NPC, ref, set, frame=-1, begin variable(sl) sl := get NPC slice(ref) set tall walkabout slice(sl, set) if(frame >= 0) then( set NPC direction(ref, frame / 2) set NPC frame(ref, frame ,mod, 2) ) end ########################################################################