forked from KristalTeam/Kristal
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #328 from Simbel0/dpr-feature
Oh fuck he's back
- Loading branch information
Showing
39 changed files
with
2,820 additions
and
1,072 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
-- Instead of Item, create a HealItem, a convenient class for consumable healing items | ||
local item, super = Class(HealItem, "duoplicate") | ||
|
||
function item:init() | ||
super.init(self) | ||
|
||
-- Display name | ||
self.name = "Duoplicate" | ||
|
||
-- Item type (item, key, weapon, armor) | ||
self.type = "item" | ||
-- Item icon (for equipment) | ||
self.icon = nil | ||
|
||
-- Battle description | ||
self.effect = "Heals\n40 HP" | ||
-- Shop description | ||
self.shop = "A little\nbit unstable\n+40 HP" | ||
-- Menu description | ||
self.description = "An item that can apparently duplicates.\nLet's hope there won't be an overflow. +40 HP" | ||
|
||
-- Amount healed (HealItem variable) | ||
self.heal_amount = 40 | ||
|
||
-- Default shop price (sell price is halved) | ||
self.price = 2222 | ||
-- Whether the item can be sold | ||
self.can_sell = true | ||
|
||
-- Consumable target mode (ally, party, enemy, enemies, or none) | ||
self.target = "ally" | ||
-- Where this item can be used (world, battle, all, or none) | ||
self.usable_in = "all" | ||
-- Will this item be instantly consumed in battles? | ||
self.instant = false | ||
|
||
-- Equip bonuses (for weapons and armor) | ||
self.bonuses = {} | ||
-- Bonus name and icon (displayed in equip menu) | ||
self.bonus_name = nil | ||
self.bonus_icon = nil | ||
|
||
-- Equippable characters (default true for armors, false for weapons) | ||
self.can_equip = {} | ||
end | ||
|
||
function item:onWorldUse(target) | ||
local amount = self:getWorldHealAmount(target.id) | ||
Game.world:heal(target, amount) | ||
Game.world:startCutscene(function(cutscene) | ||
local subject, verb = "You", "eat" | ||
if target.id ~= Mod:getLeader().id then | ||
subject = target.name | ||
verb = "eats" | ||
end | ||
cutscene:text("* "..subject.." "..verb.." the Duoplicate.") | ||
cutscene:text("* ...") | ||
local count = 0 | ||
while not Game.inventory:isFull("items", false) do | ||
Game.inventory:addItemTo("items", "unoplica", false) | ||
count = count + 1 | ||
if count > 10 then break end --safe break just in case | ||
end | ||
local texttexttext | ||
if count > 0 then | ||
texttexttext = "* Oh god, it's duplicating!!" | ||
for i=1,count-1 do | ||
texttexttext = texttexttext.."\n* Oh god, it's duplicating!!" | ||
end | ||
else | ||
texttexttext = "* The item tried to duplicate itself, but failed." | ||
end | ||
cutscene:text(texttexttext) | ||
end) | ||
return true | ||
end | ||
|
||
function item:onBattleUse(user, target) | ||
local count = 0 | ||
while not Game.inventory:isFull("items", false) do | ||
Game.inventory:addItemTo("items", "unoplica", false) | ||
count = count + 1 | ||
if count > 10 then break end --safe break just in case | ||
end | ||
return true | ||
end | ||
|
||
return item |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
-- Instead of Item, create a HealItem, a convenient class for consumable healing items | ||
local item, super = Class(HealItem, "unoplicate") | ||
|
||
function item:init() | ||
super.init(self) | ||
|
||
-- Display name | ||
self.name = "Unoplicate" | ||
|
||
-- Item type (item, key, weapon, armor) | ||
self.type = "item" | ||
-- Item icon (for equipment) | ||
self.icon = nil | ||
|
||
-- Battle description | ||
self.effect = "Heals\n20 HP" | ||
-- Shop description | ||
self.shop = nil | ||
-- Menu description | ||
self.description = "A duplicate of a duplicating item.\nThankfully it won't duplicate anymore. +20HP" | ||
|
||
-- Amount healed (HealItem variable) | ||
self.heal_amount = 20 | ||
|
||
-- Default shop price (sell price is halved) | ||
self.price = 11 | ||
-- Whether the item can be sold | ||
self.can_sell = false | ||
|
||
-- Consumable target mode (ally, party, enemy, enemies, or none) | ||
self.target = "ally" | ||
-- Where this item can be used (world, battle, all, or none) | ||
self.usable_in = "all" | ||
-- Will this item be instantly consumed in battles? | ||
self.instant = false | ||
|
||
-- Equip bonuses (for weapons and armor) | ||
self.bonuses = {} | ||
-- Bonus name and icon (displayed in equip menu) | ||
self.bonus_name = nil | ||
self.bonus_icon = nil | ||
|
||
-- Equippable characters (default true for armors, false for weapons) | ||
self.can_equip = {} | ||
end | ||
|
||
return item |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
local item, super = Class(Item, "sfb_key") | ||
|
||
function item:init() | ||
super.init(self) | ||
|
||
-- Display name | ||
self.name = "Blue Key" | ||
-- Name displayed when used in battle (optional) | ||
self.use_name = nil | ||
|
||
-- Item type (item, key, weapon, armor) | ||
self.type = "key" | ||
-- Item icon (for equipment) | ||
self.icon = nil | ||
|
||
-- Battle description | ||
self.effect = "" | ||
-- Shop description | ||
self.shop = "It looks out\nof this world." | ||
-- Menu description | ||
self.description = "A key that open the way to a corrupted world.\nLooks like a key from a popular 16-bits game..." | ||
|
||
-- Default shop price (sell price is halved) | ||
self.price = 666 | ||
-- Whether the item can be sold | ||
self.can_sell = false | ||
|
||
-- Consumable target mode (ally, party, enemy, enemies, or none) | ||
self.target = "none" | ||
-- Where this item can be used (world, battle, all, or none) | ||
self.usable_in = "world" | ||
-- Item this item will get turned into when consumed | ||
self.result_item = nil | ||
-- Will this item be instantly consumed in battles? | ||
self.instant = false | ||
|
||
-- Equip bonuses (for weapons and armor) | ||
self.bonuses = {} | ||
-- Bonus name and icon (displayed in equip menu) | ||
self.bonus_name = nil | ||
self.bonus_icon = nil | ||
|
||
-- Equippable characters (default true for armors, false for weapons) | ||
self.can_equip = {} | ||
|
||
-- Character reactions (key = party member id) | ||
self.reactions = {} | ||
end | ||
|
||
function item:onWorldUse() | ||
Game.world:startCutscene(function(cutscene) | ||
Assets.playSound("tada") | ||
|
||
local world_music = false | ||
if Game.world.music:isPlaying() and Game.world.music.volume > 0 then | ||
world_music = true | ||
Game.world.music:pause() | ||
end | ||
|
||
local leader = Game.world.player | ||
local key, og_facing | ||
if leader.actor.id == "YOU" or leader.actor.id == "kris" then | ||
leader:setSprite("hold_key") | ||
else | ||
og_facing = leader.facing | ||
leader:setFacing("down") | ||
key = Sprite("world/cutscenes/sfb_key") | ||
key:setOrigin(0.5, 1) | ||
key:setPosition(leader.width/2, 0) | ||
leader:addChild(key) | ||
end | ||
Input.clear("confirm") | ||
cutscene:wait(1/60) -- Wait for a frame so the confirm input from selecting the item doesn't affect the wait condition below | ||
cutscene:wait(function() | ||
return Input.pressed("confirm") | ||
end) | ||
leader:resetSprite() | ||
if key then | ||
leader:setFacing(og_facing) | ||
key:remove() | ||
end | ||
if world_music then | ||
Game.world.music:resume() | ||
end | ||
end) | ||
end | ||
|
||
function item:convertToLight(inventory) | ||
return "light/old_cartridge" | ||
end | ||
|
||
function item:getBuyPrice() | ||
return (self.buy_price or self:getPrice())*Mod:getPartyLove() | ||
end | ||
|
||
return item |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
local item, super = Class(Item, "light/old_cartridge") | ||
|
||
function item:init() | ||
super.init(self) | ||
|
||
-- Display name | ||
self.name = "Old Cartridge" | ||
|
||
-- Item type (item, key, weapon, armor) | ||
self.type = "key" | ||
|
||
self.light = true | ||
|
||
-- Menu description | ||
self.check = "A game cartridge for an old console. The sticker was torn by time." | ||
end | ||
|
||
function item:onWorldUse() | ||
Game.world:showText("* You look at the cartridge in admiration.[wait:5]\nNothing happened.") | ||
end | ||
|
||
function item:convertToDark(inventory) | ||
return "sfb_key" | ||
end | ||
|
||
function item:onToss() | ||
Game.world:startCutscene(function(cutscene) | ||
cutscene:text("* Throwing it away doesn't feel right.") | ||
cutscene:text("* Do it anyway?") | ||
if cutscene:choicer({"Yes", "No"}) == 1 then | ||
Game.inventory:removeItem(self) | ||
cutscene:text("* You drop the cartridge and crush it with your foot.") | ||
cutscene:text("* It feels like you decieved someone...") | ||
Game.world.timer:everyInstant(1/20, function() Assets.playSound("voice/jeku") end, 20) | ||
else | ||
cutscene:text("* It feels right.") | ||
end | ||
end) | ||
return false | ||
end | ||
|
||
return item |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.