Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

CPP := g++
CC := gcc
LD := g++

CFLAGS :=
LDFLAGS := -lcurses

CXX_SRC_FILES := $(wildcard src/OmegaRPG/src/*.cpp)
CXX_OBJS := $(patsubst src/OmegaRPG/src/%.cpp, obj/%.op, $(CXX_SRC_FILES))

C_SRC_FILES := $(wildcard src/OmegaRPG/src/*.c)
C_OBJS := $(patsubst src/OmegaRPG/src/%.c, obj/%.o, $(C_SRC_FILES))

omega : dir cppobj cobj
$(LD) $(LDFLAGS) -o $@ $(CXX_OBJS) $(C_OBJS)

cppobj : $(CXX_OBJS)

cobj : $(C_OBJS)

obj/%.o : src/OmegaRPG/src/%.c
$(CC) $(CFLAGS) -o $@ -c $<

obj/%.op : src/OmegaRPG/src/%.cpp
$(CPP) $(CFLAGS) -o $@ -c $<

dir :
mkdir -p obj

clean :
rm -rf obj/
110 changes: 50 additions & 60 deletions Omega/src/Food.cpp
Original file line number Diff line number Diff line change
@@ -1,60 +1,50 @@
#include "glob.h"
#include "Food.h"

Food::Food(void)
{
weight = 20;
plus = charge = dmg = hit = fragility = blessing = 0;

/* how full the food makes you feel */
aux = 8;

number = 1;
basevalue = 2;

uniqueness = COMMON;
level = 0;
objchar = FOOD;
usef = I_FOOD;
objstr = "food ration";
truename = "food ration";
cursestr = "food ration";
}

Food::~Food(void)
{
}

void Food::initialize()
{
}

// Consume the food. Destroying object takes place in eat command: command2.c/eat()
void Food::use()
{
// Adjust player's hunger
Player.food = max(0, Player.food + aux);

// Print flavor message
switch (random_range(6))
{
case 0:
mprint("That tasted horrible!");
break;
case 1:
mprint("Yum!");
break;
case 2:
mprint("How nauseous!");
break;
case 3:
mprint("Can I have some more? Please?");
break;
case 4:
mprint("Your mouth feels like it is growing hair!");
break;
case 5:
mprint("Tastes like home cooking!");
break;
}
}
#include <string>
#include "glob.h"
#include "Food.h"

Food::Food(void)
{
weight = 20;
plus = charge = dmg = hit = fragility = blessing = 0;

/* how full the food makes you feel */
aux = 8;

number = 1;
basevalue = 2;

uniqueness = COMMON;
level = 0;
objchar = FOOD;
usef = I_FOOD;
objstr = "food ration";
truename = "food ration";
cursestr = "food ration";
}

Food::~Food(void)
{
}

void Food::initialize()
{
}

// Consume the food. Destroying object takes place in eat command: command2.c/eat()
void Food::use()
{
// Adjust player's hunger
Player.food = max(0, Player.food + aux);

std::string comments[] = {
"That tasted horrible!",
"Yum!",
"How nauseous!",
"Can I have some more? Please?",
"Your mouth feels like it is growing hair!",
"Tastes like home cooking!",
"Appalling."
};

mprint((char*)comments[random_range(7)].c_str());
}
24 changes: 12 additions & 12 deletions Omega/src/Food.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#pragma once
#include "Object.h"

class Food : public Object
{
public:
Food();
~Food();

virtual void initialize();
virtual void use();
};
#pragma once
#include "Object.h"
class Food : public Object
{
public:
Food();
~Food();
virtual void initialize();
virtual void use();
};
1 change: 0 additions & 1 deletion Omega/src/Monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,6 @@ void Monster::m_death()
break;
case 16:
if (random_range(3)) {
/* paraphrase of harlan ellison... ? PGM */
mprint("It doesn't rain this day, anywhere in the known universe.");
} else {
mprint("The universal equilibrium slides down a notch.");
Expand Down
Loading