Skip to content

Commit

Permalink
Some UI improvements, configurable options
Browse files Browse the repository at this point in the history
  • Loading branch information
Whales committed Aug 26, 2012
1 parent 8b99eef commit 2cccc87
Show file tree
Hide file tree
Showing 30 changed files with 802 additions and 183 deletions.
5 changes: 3 additions & 2 deletions Makefile
Expand Up @@ -3,8 +3,9 @@
# DEBUG is best turned on if you plan to debug in gdb -- please do!
# PROFILE is for use with gprof or a similar program -- don't bother generally
#WARNINGS = -Wall -Wextra -Wno-switch -Wno-sign-compare -Wno-missing-braces -Wno-unused-parameter -Wno-char-subscripts
#DEBUG = -g
DEBUG = -g
#PROFILE = -pg
#OTHERS = -O3

ODIR = obj
DDIR = .deps
Expand All @@ -14,7 +15,7 @@ TARGET = cataclysm
OS = $(shell uname -o)
CXX = g++

CFLAGS = $(WARNINGS) $(DEBUG) $(PROFILE)
CFLAGS = $(WARNINGS) $(DEBUG) $(PROFILE) $(OTHERS)

ifeq ($(OS), Msys)
LDFLAGS = -static -lpdcurses
Expand Down
3 changes: 2 additions & 1 deletion Makefile.Windows
Expand Up @@ -5,6 +5,7 @@
#WARNINGS = -Wall -Wextra -Wno-switch -Wno-sign-compare -Wno-missing-braces -Wno-unused-parameter -Wno-char-subscripts
#DEBUG = -g
#PROFILE = -pg
OTHERS = -O3

ODIR = objwin
DDIR = .deps
Expand All @@ -16,7 +17,7 @@ CXX = i486-mingw32-g++
LINKER = i486-mingw32-ld
LINKERFLAGS = -Wl,-stack,12000000,-subsystem,windows

CFLAGS = $(WARNINGS) $(DEBUG) $(PROFILE)
CFLAGS = $(WARNINGS) $(DEBUG) $(PROFILE) $(OTHERS)

LDFLAGS = -static -lgdi32

Expand Down
26 changes: 18 additions & 8 deletions calendar.cpp
@@ -1,6 +1,7 @@
#include <sstream>
#include "calendar.h"
#include "output.h"
#include "options.h"

calendar::calendar()
{
Expand Down Expand Up @@ -340,17 +341,26 @@ std::string calendar::print_time(bool twentyfour)
ret << "0";
ret << minute;
} else {
int hours = hour % 12;
if (hours == 0)
hours = 12;
ret << hours << ":";
if (OPTIONS[OPT_24_HOUR]) {
int hours = hour % 24;
if (hours < 10)
ret << "0";
ret << hours;
} else {
int hours = hour % 12;
if (hours == 0)
hours = 12;
ret << hours << ":";
}
if (minute < 10)
ret << "0";
ret << minute;
if (hour < 12)
ret << " AM";
else
ret << " PM";
if (!OPTIONS[OPT_24_HOUR]) {
if (hour < 12)
ret << " AM";
else
ret << " PM";
}
}

return ret.str();
Expand Down
7 changes: 1 addition & 6 deletions crafting.cpp
Expand Up @@ -242,13 +242,11 @@ RECIPE(itm_c4, CC_WEAPON, sk_mechanics, sk_electronics, 4, 8000);

RECIPE(itm_oj, CC_FOOD, sk_cooking, sk_null, 1, 5000);
TOOL(itm_rock, -1, itm_toolset, -1, NULL);
COMP(itm_bottle_plastic, 1, NULL);
COMP(itm_orange, 2, NULL);
COMP(itm_water, 1, NULL);

RECIPE(itm_apple_cider, CC_FOOD, sk_cooking, sk_null, 2, 7000);
TOOL(itm_rock, -1, itm_toolset, -1, NULL);
COMP(itm_bottle_plastic, 1, NULL);
COMP(itm_apple, 3, NULL);

RECIPE(itm_jerky, CC_FOOD, sk_cooking, sk_null, 2, 30000);
Expand All @@ -257,7 +255,6 @@ RECIPE(itm_c4, CC_WEAPON, sk_mechanics, sk_electronics, 4, 8000);
COMP(itm_meat, 1, NULL);

RECIPE(itm_V8, CC_FOOD, sk_cooking, sk_null, 2, 5000);
COMP(itm_can_drink, 1, NULL);
COMP(itm_tomato, 1, NULL);
COMP(itm_broccoli, 1, NULL);
COMP(itm_zucchini, 1, NULL);
Expand All @@ -267,15 +264,13 @@ RECIPE(itm_c4, CC_WEAPON, sk_mechanics, sk_electronics, 4, 8000);
TOOL(itm_pot, -1, NULL);
COMP(itm_water, 1, NULL);
COMP(itm_broccoli, 1, itm_zucchini, 1, itm_veggy, 1, NULL);
COMP(itm_can_food, 1, NULL);

RECIPE(itm_soup, CC_FOOD, sk_cooking, sk_null, 3, 10000);
TOOL(itm_hotplate, 5, itm_toolset, 3, itm_fire, -1, NULL);
TOOL(itm_pot, -1, NULL);
COMP(itm_broth, 2, NULL);
COMP(itm_macaroni_raw, 1, itm_potato_raw, 1, NULL);
COMP(itm_tomato, 2, itm_broccoli, 2, itm_zucchini, 2, itm_veggy, 2, NULL);
COMP(itm_can_food, 1, NULL);

RECIPE(itm_bread, CC_FOOD, sk_cooking, sk_null, 3, 20000);
TOOL(itm_hotplate, 8, itm_toolset, 4, itm_fire, -1, NULL);
Expand Down Expand Up @@ -325,7 +320,7 @@ RECIPE(itm_c4, CC_WEAPON, sk_mechanics, sk_electronics, 4, 8000);

RECIPE(itm_purifier, CC_FOOD, sk_cooking, sk_firstaid, 9, 10000);
TOOL(itm_hotplate, 25, itm_toolset, 12, itm_fire, -1, NULL);
COMP(itm_royal_jelly, 3, itm_mutagen, 1, NULL);
COMP(itm_royal_jelly, 4, itm_mutagen, 2, NULL);
COMP(itm_bleach, 3, NULL);
COMP(itm_ammonia, 2, NULL);

Expand Down
4 changes: 2 additions & 2 deletions disease.h
Expand Up @@ -513,9 +513,9 @@ void dis_effect(game *g, player &p, disease &dis)
g->add_msg("You're suddenly wracked with pain and nausea!");
p.hurt(g, bp_torso, 0, 1);
}
if ((p.has_trait(PF_WEAKSTOMACH) && one_in(350 + bonus)) ||
if ((p.has_trait(PF_WEAKSTOMACH) && one_in(300 + bonus)) ||
(p.has_trait(PF_NAUSEA) && one_in(50 + bonus)) ||
one_in(900 + bonus))
one_in(600 + bonus))
p.vomit(g);
p.str_cur -= 3;
p.dex_cur--;
Expand Down

0 comments on commit 2cccc87

Please sign in to comment.