Attached Files |
expand+lua+script+engine.patch [^] (2,054 bytes) 2011-11-16 17:24 [Show Content] [Hide Content]From faea44ec6d171e1e1118c1ac7c549438618170f5 Wed, 16 Nov 2011 14:24:11 -0200
From: Kek <tuk kek at gmail com>
Date: Wed, 16 Nov 2011 14:07:47 -0200
Subject: [PATCH] expand lua script engine
diff --git a/crawl-ref/source/l_item.cc b/crawl-ref/source/l_item.cc
index 640e292..61b8dd2 100644
--- a/crawl-ref/source/l_item.cc
+++ b/crawl-ref/source/l_item.cc
@@ -550,6 +550,16 @@
return (1);
}
+IDEF(is_useless)
+{
+ if (!item || !item->defined())
+ return (0);
+
+ lua_pushboolean(ls, is_useless_item(*item));
+
+ return (1);
+}
+
IDEF(artefact)
{
if (!item || !item->defined())
@@ -999,6 +1009,7 @@
{ "dropped", l_item_dropped },
{ "can_cut_meat", l_item_can_cut_meat },
{ "is_bad_food", l_item_is_bad_food },
+ { "is_useless", l_item_is_useless },
{ "pluses", l_item_pluses },
{ "destroy", l_item_destroy },
{ "dec_quantity", l_item_dec_quantity },
diff --git a/crawl-ref/source/l_you.cc b/crawl-ref/source/l_you.cc
index 9311b0c..b62ecef 100644
--- a/crawl-ref/source/l_you.cc
+++ b/crawl-ref/source/l_you.cc
@@ -19,6 +19,7 @@
#include "newgame.h"
#include "ng-setup.h"
#include "mapmark.h"
+#include "misc.h"
#include "mon-util.h"
#include "mutation.h"
#include "jobs.h"
@@ -124,6 +125,8 @@
LUARET1(you_rotting, boolean, you.rotting)
LUARET1(you_silenced, boolean, silenced(you.pos()))
LUARET1(you_sick, boolean, you.disease)
+LUARET1(you_contaminated, boolean, you.magic_contamination!=0)
+LUARET1(you_feel_safe, boolean, i_feel_safe())
LUARET1(you_deaths, number, you.deaths)
LUARET1(you_lives, number, you.lives)
@@ -321,7 +324,9 @@
{ "rotting", you_rotting },
{ "silenced", you_silenced },
{ "sick", you_sick },
- { "deaths", you_deaths },
+ { "contaminated", you_contaminated },
+ { "feel_safe", you_feel_safe },
+ { "deaths", you_deaths },
{ "lives", you_lives },
{ "piety_rank", you_piety_rank },
{ "max_burden", you_max_burden },
Lua+script+engine+extension%3A+you.caught%28%29.patch [^] (1,016 bytes) 2011-11-20 21:47 [Show Content] [Hide Content]From 1cc8a647a226c406f77def4fe097a76db897b17e Sun, 20 Nov 2011 18:47:23 -0200
From: Kek <tuk kek at gmail com>
Date: Sun, 20 Nov 2011 18:46:05 -0200
Subject: [PATCH] Lua script engine extension: you.caught()
diff --git a/crawl-ref/source/l_you.cc b/crawl-ref/source/l_you.cc
index b62ecef..ab8f666 100644
--- a/crawl-ref/source/l_you.cc
+++ b/crawl-ref/source/l_you.cc
@@ -114,6 +114,7 @@
LUARET1(you_berserk, boolean, you.berserk())
LUARET1(you_confused, boolean, you.confused())
LUARET1(you_paralysed, boolean, you.paralysed())
+LUARET1(you_caught, boolean, you.caught())
LUARET1(you_asleep, boolean, you.asleep())
LUARET1(you_hasted, boolean, you.duration[DUR_HASTE])
LUARET1(you_slowed, boolean, you.duration[DUR_SLOW])
@@ -313,6 +314,7 @@
{ "berserk", you_berserk },
{ "confused", you_confused },
{ "paralysed", you_paralysed },
+ { "caught", you_caught },
{ "asleep", you_asleep },
{ "hasted", you_hasted },
{ "slowed", you_slowed },
Lua+script+engine+extension%3A+options.autopick_on.patch [^] (1,118 bytes) 2011-11-21 02:39 [Show Content] [Hide Content]From e523dd2bf0414541bcd16ad22f05f071e5472eaf Sun, 20 Nov 2011 23:29:54 -0200
From: Kek <tuk kek at gmail com>
Date: Sun, 20 Nov 2011 23:24:46 -0200
Subject: [PATCH] Lua script engine extension: options.autopick_on
diff --git a/crawl-ref/source/l_option.cc b/crawl-ref/source/l_option.cc
index b3a0d07..2ed650e 100644
--- a/crawl-ref/source/l_option.cc
+++ b/crawl-ref/source/l_option.cc
@@ -32,6 +32,13 @@
}
}
+static int option_autopick(lua_State *ls, const char *name, void *data,
+ bool get)
+{
+ lua_pushboolean(ls, Options.autopickup_on>0);
+ return (1);
+}
+
static option_handler handlers[] =
{
// Boolean options come first
@@ -54,7 +61,8 @@
{ "dos_use_background_intensity", &Options.dos_use_background_intensity,
option_hboolean },
{ "menu_colour_prefix_class", &Options.menu_colour_prefix_class,
- option_hboolean }
+ option_hboolean },
+ { "autopick_on", NULL, option_autopick }
};
static const option_handler *get_handler(const char *optname)
Lua+script+engine+extension%3A+you.shrouded.patch [^] (1,027 bytes) 2011-12-01 18:09 [Show Content] [Hide Content]From 76bf564163b01e3e9f886a195f876729ca25d1fe Thu, 1 Dec 2011 15:09:16 -0200
From: Kek <tuk kek at gmail com>
Date: Thu, 1 Dec 2011 15:07:27 -0200
Subject: [PATCH] Lua script engine extension: you.shrouded
diff --git a/crawl-ref/source/l_you.cc b/crawl-ref/source/l_you.cc
index ab8f666..fb5402e 100644
--- a/crawl-ref/source/l_you.cc
+++ b/crawl-ref/source/l_you.cc
@@ -113,6 +113,7 @@
LUARET1(you_transform, string, transform_name())
LUARET1(you_berserk, boolean, you.berserk())
LUARET1(you_confused, boolean, you.confused())
+LUARET1(you_shrouded, boolean, you.duration[DUR_SHROUD_OF_GOLUBRIA])
LUARET1(you_paralysed, boolean, you.paralysed())
LUARET1(you_caught, boolean, you.caught())
LUARET1(you_asleep, boolean, you.asleep())
@@ -314,6 +315,7 @@
{ "berserk", you_berserk },
{ "confused", you_confused },
{ "paralysed", you_paralysed },
+ { "shrouded", you_shrouded },
{ "caught", you_caught },
{ "asleep", you_asleep },
{ "hasted", you_hasted },
Lua+script+engine+extension%3A+you.swift.patch [^] (1,030 bytes) 2011-12-07 03:00 [Show Content] [Hide Content]From d31ebcfd32118ed76c3bb8eb81d0050d22a79142 Tue, 6 Dec 2011 23:59:41 -0200
From: Kek <tuk kek at gmail com>
Date: Tue, 6 Dec 2011 23:58:39 -0200
Subject: [PATCH] Lua script engine extension: you.swift
diff --git a/crawl-ref/source/l_you.cc b/crawl-ref/source/l_you.cc
index fb5402e..19ce9bb 100644
--- a/crawl-ref/source/l_you.cc
+++ b/crawl-ref/source/l_you.cc
@@ -114,6 +114,7 @@
LUARET1(you_berserk, boolean, you.berserk())
LUARET1(you_confused, boolean, you.confused())
LUARET1(you_shrouded, boolean, you.duration[DUR_SHROUD_OF_GOLUBRIA])
+LUARET1(you_swift, boolean, you.duration[DUR_SWIFTNESS])
LUARET1(you_paralysed, boolean, you.paralysed())
LUARET1(you_caught, boolean, you.caught())
LUARET1(you_asleep, boolean, you.asleep())
@@ -316,6 +317,7 @@
{ "confused", you_confused },
{ "paralysed", you_paralysed },
{ "shrouded", you_shrouded },
+ { "swift", you_swift },
{ "caught", you_caught },
{ "asleep", you_asleep },
{ "hasted", you_hasted },
|