Resting for a number of turns

All development conversation and discussion takes place here

Moderator: Moderator

Post Reply
Message
Author
deadram
Low Yeek
Posts: 9
Joined: Sun Jan 09, 2011 3:03 pm

Resting for a number of turns

#1 Post by deadram »

I got tired of pounding the numpad 5 button XD At the moment this is missing the ability to tell when all 'rechargeables' like talents, items, etc... are ready to be used :/ You can just rest indefinitely (well 9999 turns) and click cancel when your doodad is ready :P

Code: Select all

diff -ur t-engine4-src-1.0.0beta18/game/engines/default/data/keybinds/actions.lua t-engine4-src-1.0.0beta18-restturns/game/engines/default/data/keybinds/actions.lua
--- t-engine4-src-1.0.0beta18/game/engines/default/data/keybinds/actions.lua    2010-10-12 08:08:51.000000000 -0400
+++ t-engine4-src-1.0.0beta18-restturns/game/engines/default/data/keybinds/actions.lua  2011-01-12 09:19:57.000000000 -0500
@@ -52,6 +52,13 @@
 }
 
 defineAction{
+       default = {  },
+       type = "RESTTURNS",
+       group = "actions",
+       name = "Rest for a number of turns",
+}
+
+defineAction{
        default = { "sym:115:true:false:false:false" },
        type = "SAVE_GAME",
        group = "actions",
diff -ur t-engine4-src-1.0.0beta18/game/modules/tome/class/Game.lua t-engine4-src-1.0.0beta18-restturns/game/modules/tome/class/Game.lua
--- t-engine4-src-1.0.0beta18/game/modules/tome/class/Game.lua  2010-12-30 19:11:39.000000000 -0500
+++ t-engine4-src-1.0.0beta18-restturns/game/modules/tome/class/Game.lua        2011-01-12 09:20:09.000000000 -0500
@@ -809,6 +809,20 @@
                        self.player:restInit()
                end,
 
+               RESTTURNS = function()
+                       local GetQuantity = require "engine.dialogs.GetQuantity"
+                       local q = GetQuantity.new("Resting", "Rest for how long?", 0, 9999, function(qty)
+                                       if not qty or qty == 0 then
+                                               --- Placeholder, this should eventually rest till all skills, items, runes, infusion, etc... are ready
+                                               --- Maybe find further-est from fully recharged and rest that many ticks?
+                                               --- Dono enough about the code yet to do that XD
+                                               qty = 9999
+                                       end
+                                       self.player:restInit(qty-1)
+                               end)
+                       game:registerDialog(q)
+               end,
+
                PICKUP_FLOOR = not_wild(function()
                        self.player:playerPickup()
                end),
Ohhh, and I release the rights, and all that blah blah
echo -en "--\ndeadram\n\n";fortune | sed 's/^/ /'

deadram
Low Yeek
Posts: 9
Joined: Sun Jan 09, 2011 3:03 pm

Re: Resting for a number of turns

#2 Post by deadram »

Noticed a potential problem... I have the game setup to save always and anytime, but for people who don't, resting should be stopped while using a Recall or Teleport: <city>. Also, now that I think of it... digging during the later part of a Recall might be bugged too... Anywho, here's the fix for the mod above (and maybe digging) :)

Code: Select all

diff -ur t-engine4-src-1.0.0beta18/game/modules/tome/data/timed_effects.lua t-engine4-src-1.0.0beta18-restturns/game/modules/tome/data/timed_effects.lua
--- t-engine4-src-1.0.0beta18/game/modules/tome/data/timed_effects.lua  2010-12-28 07:20:42.000000000 -0500
+++ t-engine4-src-1.0.0beta18-restturns/game/modules/tome/data/timed_effects.lua        2011-01-13 17:43:00.000000000 -0500
@@ -1976,6 +1976,7 @@
                if self:canBe("worldport") then
                        game:onTickEnd(function()
                                game.logPlayer(self, "You are yanked out of this place!")
+                               game.player:restStop("Recalling")
                                game:changeLevel(1, game.player.last_wilderness)
                        end)
                else
@@ -2008,6 +2009,7 @@
                if self:canBe("worldport") then
                        game:onTickEnd(function()
                                game.logPlayer(self, "You are yanked out of this place!")
+                               game.player:restStop("Teleport: Angolwen")
                                game:changeLevel(1, "town-angolwen")
                        end)
                else
-- EDIT --

Maybe a moderator should move this to bugs for this latest post? Should probably check to see if it's true first though (ie: does moving to world map force a rest reset under any different save options; Since the digging function actually uses the rest functionality to count up turns).
echo -en "--\ndeadram\n\n";fortune | sed 's/^/ /'

Post Reply