]> git.localhorst.tv Git - l2e.git/commitdiff
added battle/monster file structure
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Fri, 3 Aug 2012 17:31:35 +0000 (19:31 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Fri, 3 Aug 2012 17:31:35 +0000 (19:31 +0200)
Debug/makefile
Debug/sources.mk
Debug/src/battle/subdir.mk [new file with mode: 0644]
Release/makefile
Release/sources.mk
Release/src/battle/subdir.mk [new file with mode: 0644]
src/battle/Monster.cpp [new file with mode: 0644]
src/battle/Monster.h [new file with mode: 0644]

index 7439cadb2393e57aad28b62b2db3c663d27b0b8d..253ef222bb3c6a8816699f62b04761f288f7bb07 100644 (file)
@@ -9,6 +9,7 @@ RM := rm -rf
 # All of the sources participating in the build are defined here
 -include sources.mk
 -include src/sdl/subdir.mk
+-include src/battle/subdir.mk
 -include src/subdir.mk
 -include subdir.mk
 -include objects.mk
index 414d5595efb298ef462d8085f64bc8203167e610..8a951acbb83854324a8f740d93719764d37743c5 100644 (file)
@@ -25,4 +25,5 @@ C_UPPER_DEPS :=
 SUBDIRS := \
 src/sdl \
 src \
+src/battle \
 
diff --git a/Debug/src/battle/subdir.mk b/Debug/src/battle/subdir.mk
new file mode 100644 (file)
index 0000000..37e4161
--- /dev/null
@@ -0,0 +1,24 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+# Add inputs and outputs from these tool invocations to the build variables 
+CPP_SRCS += \
+../src/battle/Monster.cpp 
+
+OBJS += \
+./src/battle/Monster.o 
+
+CPP_DEPS += \
+./src/battle/Monster.d 
+
+
+# Each subdirectory must supply rules for building sources it contributes
+src/battle/%.o: ../src/battle/%.cpp
+       @echo 'Building file: $<'
+       @echo 'Invoking: GCC C++ Compiler'
+       g++ -I/usr/include/SDL -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
+       @echo 'Finished building: $<'
+       @echo ' '
+
+
index 7439cadb2393e57aad28b62b2db3c663d27b0b8d..253ef222bb3c6a8816699f62b04761f288f7bb07 100644 (file)
@@ -9,6 +9,7 @@ RM := rm -rf
 # All of the sources participating in the build are defined here
 -include sources.mk
 -include src/sdl/subdir.mk
+-include src/battle/subdir.mk
 -include src/subdir.mk
 -include subdir.mk
 -include objects.mk
index 414d5595efb298ef462d8085f64bc8203167e610..8a951acbb83854324a8f740d93719764d37743c5 100644 (file)
@@ -25,4 +25,5 @@ C_UPPER_DEPS :=
 SUBDIRS := \
 src/sdl \
 src \
+src/battle \
 
diff --git a/Release/src/battle/subdir.mk b/Release/src/battle/subdir.mk
new file mode 100644 (file)
index 0000000..213b6f0
--- /dev/null
@@ -0,0 +1,24 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+# Add inputs and outputs from these tool invocations to the build variables 
+CPP_SRCS += \
+../src/battle/Monster.cpp 
+
+OBJS += \
+./src/battle/Monster.o 
+
+CPP_DEPS += \
+./src/battle/Monster.d 
+
+
+# Each subdirectory must supply rules for building sources it contributes
+src/battle/%.o: ../src/battle/%.cpp
+       @echo 'Building file: $<'
+       @echo 'Invoking: GCC C++ Compiler'
+       g++ -I/usr/include/SDL -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
+       @echo 'Finished building: $<'
+       @echo ' '
+
+
diff --git a/src/battle/Monster.cpp b/src/battle/Monster.cpp
new file mode 100644 (file)
index 0000000..1a52b79
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Monster.cpp
+ *
+ *  Created on: Aug 3, 2012
+ *      Author: holy
+ */
+
+#include "Monster.h"
+
+namespace battle {
+
+Monster::Monster() {
+       // TODO Auto-generated constructor stub
+
+}
+
+Monster::~Monster() {
+       // TODO Auto-generated destructor stub
+
+}
+
+} /* namespace battle */
diff --git a/src/battle/Monster.h b/src/battle/Monster.h
new file mode 100644 (file)
index 0000000..adebbb2
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * Monster.h
+ *
+ *  Created on: Aug 3, 2012
+ *      Author: holy
+ */
+
+#ifndef BATTLE_MONSTER_H_
+#define BATTLE_MONSTER_H_
+
+#include <SDL.h>
+
+namespace battle {
+
+class Monster {
+
+public:
+       Monster();
+       ~Monster();
+
+public:
+       const char *Name() const { return name; }
+       Uint8 Level() const { return level; }
+       const /* Sprite */ void *Sprite() const { return sprite; }
+
+       Uint16 MaxHealth() const { return maxHealth; }
+       Uint16 Health() const { return health; }
+       int RelativeHealth(int max) { return health * max / maxHealth; }
+
+       Uint16 MaxMana() const { return maxMana; }
+       Uint16 Mana() const { return mana; }
+       int RelativeMana(int max) { return mana * max / maxMana; }
+
+       Uint16 Attack() const { return attack; }
+       Uint16 Defense() const { return defense; }
+       Uint16 Agility() const { return agility; }
+       Uint16 Intelligence() const { return intelligence; }
+       Uint16 Gut() const { return gut; }
+       Uint16 MagicResistance() const { return magicResistance; }
+
+       Uint16 ExpReward() const { return expReward; }
+       Uint16 GoldReward() const { return goldReward; }
+
+       const /* Item */ void *DropItem() const { return dropItem; }
+       Uint8 DropChance() const { return dropChance; }
+
+       const /* Script */ void *AttackScript() { return attackScript; }
+       const /* Script */ void *DefenseScript() { return defenseScript; }
+
+private:
+       const char *name;
+       /* Sprite */ void *sprite;
+       /* Item */ void *dropItem;
+       /* Script */ void *attackScript;
+       /* Script */ void *defenseScript;
+
+       Uint16 maxHealth, health;
+       Uint16 maxMana, mana;
+
+       Uint16 attack;
+       Uint16 defense;
+       Uint16 agility;
+       Uint16 intelligence;
+       Uint16 gut;
+       Uint16 magicResistance;
+
+       Uint16 expReward, goldReward;
+
+       Uint8 level;
+       Uint8 dropChance;
+
+};
+
+}
+
+#endif /* BATTLE_MONSTER_H_ */