#include <properties.h>#include "../files.h"
gehe zum Quellcode dieser Datei
Makrodefinitionen | |
| #define | PLANT_LIFETIME (24*3600) |
| #define | DRIED_PLANT -1 |
Funktionen | |
| int | PlantQuality () |
| void | DryPlant (int qual) |
| int | TimeToLive () |
| nomask int | SetPlantId (int id) |
| nomask int | QueryPlantId () |
| varargs | create (string file) |
| string | short () |
| static int | _query_value () |
| nomask string | QueryCloner () |
Variablen | |
| inherit std | thing |
| int | age = time() |
| static private int | plantId |
| static private string | cloner |
| #define DRIED_PLANT -1 |
Definiert in Zeile 9 der Datei plant.c.
Wird benutzt von DryPlant() und short().
| #define PLANT_LIFETIME (24*3600) |
Definiert in Zeile 8 der Datei plant.c.
Wird benutzt von PlantQuality(), short() und TimeToLive().
| static int _query_value | ( | ) | [static] |
Definiert in Zeile 71 der Datei plant.c.
Benutzt P_VALUE, plantId, PlantQuality() und Query().
00072 { 00073 int val; 00074 if (plantId<=0) 00075 return 0; 00076 val=Query(P_VALUE)*PlantQuality()/100; 00077 if (val<0) return 0; 00078 return val-val%10; 00079 }

| varargs create | ( | string | file | ) |
Definiert in Zeile 24 der Datei plant.c.
Benutzt create(), KRAEUTERVC, P_MATERIAL, P_QUALITY, P_VALUE, P_WEIGHT, plantId und SetProp().
00025 { 00026 // auch die Blueprint _muss_ initialisiert sein! 00027 thing::create(); 00028 plantId=0; 00029 SetProp(P_QUALITY, 100); 00030 SetProp(P_WEIGHT, 120); 00031 SetProp(P_VALUE, 70); 00032 // _unbedingt_ umsetzen bei Zutaten die keine Pflanzen sind! 00033 SetProp(P_MATERIAL, MAT_MISC_PLANT); 00034 // hier darf _nicht_ previous_object()->CustomizeObject() verwandt werden, 00035 // da nur die Blueprint wirklich vom VC geclont wird. Fuer die Clones 00036 // ruft der Master den VC nicht jedesmal erneut auf. 00037 if (stringp(file)) file=explode(file, "/")[<1]; 00038 call_other(KRAEUTERVC, "CustomizeObject", file); 00039 }

| void DryPlant | ( | int | qual | ) |
Definiert in Zeile 81 der Datei plant.c.
Benutzt age, DRIED_PLANT, P_QUALITY, QueryProp() und SetProp().

| int PlantQuality | ( | ) |
Definiert in Zeile 52 der Datei plant.c.
Benutzt age, P_QUALITY, PLANT_LIFETIME und QueryProp().
Wird benutzt von _query_value().
00059 { 00060 int qual; 00061 if (age+PLANT_LIFETIME < time()) { 00062 qual=negate((time()-age-PLANT_LIFETIME)/360); 00063 return (qual < -100 ? -100 : qual); 00064 } 00065 return QueryProp(P_QUALITY); 00066 }


| nomask string QueryCloner | ( | ) |
| nomask int QueryPlantId | ( | ) |
| nomask int SetPlantId | ( | int | id | ) |
| string short | ( | ) |
Definiert in Zeile 41 der Datei plant.c.
Benutzt age, DRIED_PLANT, P_SHORT, PLANT_LIFETIME und QueryProp().
00042 { 00043 string str; 00044 if (!stringp(str=QueryProp(P_SHORT))) return 0; 00045 if (age==DRIED_PLANT) 00046 return str+" (getrocknet).\n"; 00047 else if (age+PLANT_LIFETIME<time()) 00048 return str+" (verschimmelt).\n"; 00049 return str+".\n"; 00050 }

| int TimeToLive | ( | ) |
Definiert in Zeile 68 der Datei plant.c.
Benutzt age und PLANT_LIFETIME.
00069 { return age-time()+PLANT_LIFETIME; }
private string cloner [static] |
Definiert in Zeile 13 der Datei plant.c.
Wird benutzt von QueryCloner() und SetPlantId().
private int plantId [static] |
Definiert in Zeile 12 der Datei plant.c.
Wird benutzt von _query_value(), create(), QueryPlantId() und SetPlantId().
1.6.3