Crossfire Server, Trunk
ObjectWrapper.cpp
Go to the documentation of this file.
1 /*
2  * Crossfire -- cooperative multi-player graphical RPG and adventure game
3  *
4  * Copyright (c) 2022 the Crossfire Development Team
5  *
6  * Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are
7  * welcome to redistribute it under certain conditions. For details, please
8  * see COPYING and LICENSE.
9  *
10  * The authors can be reached via e-mail at <crossfire@metalforge.org>.
11  */
12 
13 #include "ObjectWrapper.h"
14 #include "ResourcesManager.h"
15 #include "CREPixmap.h"
16 
17 ObjectWrapper::ObjectWrapper(AssetWrapper *parent, object *ob, ResourcesManager *resourcesManager) : AssetTWrapper(parent, "empty", ob) {
18  myResourcesManager = resourcesManager;
19 }
20 
22 }
23 
25 {
26  return myResourcesManager->wrap(myWrappedItem->arch, this);
27 }
28 
29 double scale_level(double l) {
30  if (l < 1) {
31  l = 1;
32  }
33  return 10*log(l)+1;
34 }
35 
37  return scale_level(hp()*10/100 + regen()*20/100 + dps()*20/100);
38 }
39 
40 float ObjectWrapper::dps() const {
41  return damage() * FABS(speed()) / MOVE_PER_SECOND;
42 }
43 
44 float ObjectWrapper::regen() const {
45  return con() / 4.0 / MOVE_PER_SECOND;
46 }
47 
49  if (!myWrappedItem->randomitems) {
50  return nullptr;
51  }
53 }
banquet.l
l
Definition: banquet.py:164
FABS
#define FABS(x)
Definition: define.h:22
log_born.log
log
Definition: log_born.py:28
ObjectWrapper::regen
float regen
Definition: ObjectWrapper.h:77
object::arch
struct archetype * arch
Definition: object.h:422
guildjoin.ob
ob
Definition: guildjoin.py:42
AssetTWrapper< object >::myWrappedItem
object * myWrappedItem
Definition: AssetWrapper.h:104
scale_level
double scale_level(double l)
Definition: ObjectWrapper.cpp:29
AssetWrapper
Definition: AssetWrapper.h:25
damage
TIPS on SURVIVING Crossfire is populated with a wealth of different monsters These monsters can have varying immunities and attack types In some of them can be quite a bit smarter than others It will be important for new players to learn the abilities of different monsters and learn just how much it will take to kill them This section discusses how monsters can interact with players Most monsters in the game are out to mindlessly kill and destroy the players These monsters will help boost a player s after he kills them When fighting a large amount of monsters in a single attempt to find a narrower hallway so that you are not being attacked from all sides Charging into a room full of Beholders for instance would not be open the door and fight them one at a time For there are several maps designed for them Find these areas and clear them out All throughout these a player can find signs and books which they can read by stepping onto them and hitting A to apply the book sign These messages will help the player to learn the system One more always keep an eye on your food If your food drops to your character will soon so BE CAREFUL ! NPCs Non Player Character are special monsters which have intelligence Players may be able to interact with these monsters to help solve puzzles and find items of interest To speak with a monster you suspect to be a simply move to an adjacent square to them and push the double ie Enter your and press< Return > You can also use say if you feel like typing a little extra Other NPCs may not speak to but display intelligence with their movement Some monsters can be and may attack the nearest of your enemies Others can be in that they follow you around and help you in your quest to kill enemies and find treasure SPECIAL ITEMS There are many special items which can be found in of these the most important may be the signs all a player must do is apply the handle In the case of the player must move items over the button to hold it down Some of the larger buttons may need very large items to be moved onto before they can be activated Gates and locked but be for you could fall down into a pit full of ghosts or dragons and not be able to get back out Break away sometimes it may be worth a player s time to test the walls of a map for secret doors Fire such as missile weapons and spells you will notice them going up in smoke ! So be careful not to destroy valuable items Spellbooks sometimes a player can learn the other times they cannot There are many different types of books and scrolls out there Improve item have lower higher damage
Definition: survival-guide.txt:100
ObjectWrapper::suggested_level
int suggested_level
Definition: ObjectWrapper.h:47
ResourcesManager::wrap
ArchetypeWrapper * wrap(archetype *arch, AssetWrapper *parent)
Definition: ResourcesManager.h:131
speed
Player Stats effect how well a character can survie and interact inside the crossfire world This section discusses the various what they and how they effect the player s actions Also in this section are the stat modifiers that specific classes professions bring Player and sps the current and maximum the Current and Maximum The Current Sp can go somewhat negative When Sp is negative not all spells can be and a more negative Sp makes spell casting less likey to succeed can affect Damage and how the characters speed
Definition: stats.txt:23
AssetTWrapper
Definition: AssetWrapper.h:94
ResourcesManager
Definition: ResourcesManager.h:80
ObjectWrapper::myResourcesManager
ResourcesManager * myResourcesManager
Definition: ObjectWrapper.h:96
ObjectWrapper::arch
QObject arch
Definition: ObjectWrapper.h:72
ResourcesManager.h
ObjectWrapper::randomItems
QObject randomItems
Definition: ObjectWrapper.h:75
CREPixmap.h
ObjectWrapper::~ObjectWrapper
virtual ~ObjectWrapper()
Definition: ObjectWrapper.cpp:21
object::randomitems
struct treasurelist * randomitems
Definition: object.h:395
ObjectWrapper::ObjectWrapper
ObjectWrapper(AssetWrapper *parent, object *ob, ResourcesManager *resourcesManager)
Definition: ObjectWrapper.cpp:17
ObjectWrapper::dps
float dps
Definition: ObjectWrapper.h:77
ObjectWrapper.h
MOVE_PER_SECOND
static const float MOVE_PER_SECOND
Definition: tod.h:54