Crossfire Server, Trunk
diamondslots.py
Go to the documentation of this file.
1 #SlotMachine configuration file
2 #to make a new kind of slot machine, copy this file, change the settings and point the slotmachine to the new file.
3 #Standard type Diamond Slots
4 #FYI - This one uses an object for cointype and not the money code :)
5 
6 import Crossfire
7 import CFGamble
8 import CFItemBroker
9 
10 activator=Crossfire.WhoIsActivator()
11 activatorname=activator.Name
12 whoami=Crossfire.WhoAmI()
13 #gets slot name and adds map name for unique jackpot
14 slotname= '%s#%s' %(whoami.Name,whoami.Map.Path)
15 x=activator.X
16 y=activator.Y
17 
18 cointype = "gem" #What type of coin is this slotmachine using?
19 minpot = 200 #Minimum slot jackpot size
20 maxpot = 10000 #Maxiumum slot jackpot size
21 cost = 1 #Price of usage
22 
23 #Change the items on the slot spinner or the number of items.
24 slotlist = ["Silver", "Gold", "Platinum", "Sapphire", "Emerald", "Ruby", "Diamond", "JackPot"]
25 
26 #Major as percent of pot. Minor as how many times cost
27 slotminor = [1, 2, 3, 4, 5, 6, 10, 15]
28 slotmajor = [.1, .15, .25, .30, .40, .50, .60, 1]
29 
30 spinners = 4 #How many spinners on the slotmachine?
31 
32 Slots=CFGamble.SlotMachine(slotname,slotlist,minpot,maxpot)
33 
34 object = activator.CheckInventory(cointype)
35 if (object) and not object.Unpaid:
36  pay = CFItemBroker.Item(object).subtract(cost)
37  if (pay):
38  Slots.placebet(cost)
39  results = Slots.spin(spinners)
40  pay = 0
41  pot = Slots.checkslot()
42  activator.Write('%s' %results, 7)
43  for item in results:
44  #match all but one - pays out by coin e.g 3 to 1 or 4 to 1
45  if results.count(item) == spinners-1:
46  if item in slotlist:
47  pay = slotminor[slotlist.index(item)]
48  else:
49  break
50  activator.Write("%d %ss, a minor win!" %(spinners-1,item))
51  payoff = cost*pay
52  Slots.payoff(payoff)
53  id = Crossfire.CreateObjectByName(cointype)
54  id.Quantity = payoff
55  id.InsertInto(activator)
56  if payoff == 1:
57  message = "you win %d %s!" %(payoff,cointype)
58  else:
59  message = "You win %d %ss!!" %(payoff,cointype)
60  break
61  elif results.count(item) == spinners:
62  #all match - pays out as percent of pot
63  activator.Write('%d %ss, a Major win!' %(spinners,item))
64  if item in slotlist:
65  pay = slotmajor[slotlist.index(item)]
66  else:
67  break
68  payoff = int(pot*pay)
69  Slots.payoff(payoff)
70  id = Crossfire.CreateObjectByName(cointype)
71  id.Quantity = payoff
72  id.InsertInto(activator)
73  if payoff == 1:
74  message = "you win %d %s!" %(payoff,cointype)
75  else:
76  message = "You win %d %ss!!" %(payoff,cointype)
77  break
78  else:
79  message = "Better luck next time!"
80  activator.Write(message)
81  activator.Write("%d in the Jackpot, Play again?" %Slots.checkslot())
82  else:
83  activator.Write("Sorry, you do not have enough %ss" %(cointype))
84 else:
85  activator.Write("Sorry, you do not have any %ss" %(cointype))
n
based on the size of the this randomly makes land number of spaces randomly lower or higher The default is Note that this is run also based on the the altitude amount will likely be less So if you do something like l and n
Definition: land.6.txt:25
CFGamble.SlotMachine
Definition: CFGamble.py:13
CFItemBroker.Item
Definition: CFItemBroker.py:15
is
And the skill structure used by the skills[] table is
Definition: arch-handbook.txt:577
main
main(int argc, char *argv)
Definition: land.c:277
disinfect.map
map
Definition: disinfect.py:4
maps
this information may not reflect the current implementation This brief document is meant to describe the operation of the crossfire as well as the form of the data The metaserver listens on port for tcp and on port for udp packets The server sends updates to the metaserver via udp The metaserver only does basic checking on the data that server sends It trusts the server for the ip name it provides The metaserver does add the ip address and also tracks the idle time(time since last packet received). The client gets its information from the metaserver through connecting by means of tcp. The client should retrieve http the body s content type is text plain The current metaserver implementation is in Perl But the metaserver could be in any language perl is fast enough for the amount of data that is being exchanged The response includes zero or more server entries Each entry begins with the line START_SERVER_DATA and ends with the line END_SERVER_DATA Between these lines key value pairs("key=value") may be present. The entries are sent in arbitrary order. A client should apply some ordering when displaying the entries to the user. TODO b additional information outside BEGIN_SERVER_DATA END_SERVER_DATA maps
Definition: arch-handbook.txt:189
d
How to Install a Crossfire Server on you must install a python script engine on your computer Python is the default script engine of Crossfire You can find the python engine you have only to install them The VisualC Crossfire settings are for d
Definition: INSTALL_WIN32.txt:13
there
Story behind my Island The human king of the mainland has explorers scout for new territory On one expedition to an the explorers found some flecks of gold in the river they settled next to Upon notification of the king ordered a permanent colony be established there
Definition: lore.txt:7
are
non standard information is not specified or uptime this means how long since the executable has been started A particular host may have been running a server for quite a long but due to updates or the length of time the server instance has been up may be much shorter MN US< br > link< br >< a href="http: text_comment=Latest SVN 1.x branch, Eden Prairie, MN US archbase=Standard mapbase=Standard codebase=Standard num_players=3 in_bytes=142050710 out_bytes=-1550812829 uptime=909914 version=1.11.0 sc_version=1027 cs_version=1023 last_update=1214541369 END_SERVER_DATA ---- Multigod -------- This is a brief description of the MULTIGOD hack. It is preserved here for mostly historical reasons. Introduction ~~~~~~~~~~~~ The intention of this code is to enhance the enjoy-ability and playability of clerical characters in the new skills/exp scheme. This is done by giving players gods to worship who in turn effect clerical magic and powers. Included in this patch are several new spells which (hopefully) will allow the priest characters a better chance to gain xp at higher levels. Notably, the "holy orb" and "holy word" spells have been revamped. When MULTIPLE_GODS flag is defined in include/config.h, this code is enabled. This code (described below) encompasses 3 main parts: an array of gods that players/NPCs may worship, new clerical spells which rely on the worshiped god's attrib- utes in Gods[] array and, altars/praying--the interface between a worshiper and their god. b.t. thomas@astro.psu.edu Implementation Details ~~~~~~~~~~~~~~~~~~~~~~ This code is flexible and easy to configure (just edit the god archetypes). Part of the reason for creating this code was to allow server maintainers to develop their own "mythos". From my personal point of view, I hate having the old "Christian" aligned mythos, but if that's what you like, you can replicate it with this code too (see below). Properties of the Gods ~~~~~~~~~~~~~~~~~~~~~~ Here is a fuller description of Gods archetype values. ---- name - name of the god (required) other_arch - archetype that will be used for the summon holy servant spell. title - diametrically opposed god, leave blank if none exists attacktype - favored attack of this god, used in spells of summon avatar, holy word. Recipients of "holy possession" get this too. immune - Avatars/holy servants/recipient of "holy possession" gets this. protected - all of the above AND recipient of god's blessing and the priest of this god gets this. vulnerable - Avatar/servant/recipient of gods curse/priest of this god get this. path_attuned - priest of this god and recipient of "bless" gets this path_repelled - priest and recipient of "curse" gets this path_denied - priest and recipient of "curse" gets this slaying - comma delimited list of the races of creatures that are aligned with the god. "summon cult monsters" uses. this list to find creatures. Summon avatar/call servant code assigns this value to prevent them from attacking aligned races. Value is blank if no race(s) exists. race - comma delimited list of the races of creatures "holy word", "holy possession" spells will effect. Value entry is blank if no such race(s) exists. hp,dam,ac,wc - base stats for the summoned avatar. ---- IF MORE_PRIEST_GIFTS is defined (in gods.c) then ADDITIONAL gifts/limitations will be assigned to the priest: Flags ^^^^^ Now, the following flags, in addition to being used by the god (if planted on a map) are assigned to the worshiping priest: can_use_weapon, can_use_armour, is_undead, is_blind, reflect_missile, reflect_spell, make_invisible, stealth, can_see_in_dark, xrays NOTE: if can_use_armour/can_use_weapon flags are NOT present, then the priest will be forbidden the use of these items. Stats ^^^^^ The following stats are used: ---- luck - how lucky the god (and the priest) are. last_eat - how fast priest digestion is last_hp - how fast priest healing is last_sp - how fast priest mana regeneration is last_grace - how fast priest grace regeneration is ---- Designing New Gods ~~~~~~~~~~~~~~~~~~ To examine the gods properties, use the '-m8' flag (ie 'crossfire -m8'). Note some of the big differences here in terms of spell_paths, races, etc. Most of these entries were designed with roughly polar opposite gods. For designing new gods. You should make sure that worshiping a god will be "unique" in some way. But playbalance first! You must consider the balance between the following: . spellpaths . priest gifts . priest limitations . special spells . attacktypes . summoned monster lists . properties of the avatar and holy servant. Here are some hard and fast rules for designing gods: - Decide how the cleric will get experience. The god should be either a 'summoning', 'turning' *or* a 'wounding' god. If summoning/turning, make sure the aligned_race/enemy_race list(s) has enough creatures to summon/slay at low, medium and high levels. DONT give a god attuned to wounding AND turning||summoning (in fact, at minimum, one of these 3 paths should be repelled/denied). - make sure the summoned avatar is stronger than the servant (!) - examine the avatar/servant stats. If set inproperly, you will give wimpy/super values. For example, Avatars/servants with less than 50 hp (and a high ac/no armour) will vanish quickly. Shoot for stats like: ---- type | A V E R A G E S T A T S | hp | ac | wc | arm | dam | speed ----------|----------------------------------- servant | 50 | 5 | 5 | 20 | 5 | 0.15 avatar | 350 | -5 | -1 | 50 | 50 | 0.25 ---- Its difficult to give measurements on how to trade these off. To help guide your choices try to conserve the value of speed*dam and (armour+1)*hp. * avoid giving the potent attacktypes of death, weaponmagic and paralysis. * gods have a vulnerability for every immunity. Not all attacktypes are the same. Immunity to physical, magic and common attacktypes (like fire/cold/electric) are very potent. Similarly, vuln to these is a big negative. * SPELL paths. Carefull treatment is needed here. Give a path_denied/ or a couple path_repelled for every path_attuned. BUT note: not all paths are of equal use. (ex path_abjuration has a very large list of spells). The main clerical paths are restoration, abjuration, protection, turning, wounding and summoning. For balance, make 3-4 of these repelled/denied and 1 or 2 attuned. Be sure to check out the special spells list (below). Attuned paths like DEATH, WOUNDING and (especially) PROTECTION are very potent. Allow for some balance else where if you assign (one!) of these as a path_attuned. * If using the MORE_PRIEST_GIFTS define: priest limitations of no weapons and no armour are very negative, be sure to compensate with more than an attunded path. Of course, you may break these 'rules' to create your god. When you do that, you had better make up for the bonus elsewhere! Otherwise, you will create a 'mega-god' whose worship (by the player priests) will unbalance the game. Designing a good god takes a bit of work. Special Spells ~~~~~~~~~~~~~~ Here is a possibly *incomplete* list of the special spells that a god may grant use to a worshiper. Check the file spellist.h for the 0 bookchance clerical spells to find all of these. (This list was complete on 10/96). ---- INFO perceive self PROTECTION defense; immuntity to cold, fire, electricity, poison, slow, paralysis, draining, attack, and magic RESTORE remove damnation; reincarnation; raise dead; resurrection; regeneration WOUNDING cause critical wounds; retributive strike LIGHT daylight; nightfall DEATH face of death; finger of death SUMMONING insect plague CREATE wall of thorns ---- Ideas ~~~~~ * Allow sacrifices. This is an excellent way to give a cleric xp. Need to create enemy_race creatures w/ bodyparts we can sacrifice, and designate a pointer in Gods to the appropriate array of stuff we can sacrifice for xp. Experience ---------- Obsolete file kept for historical reasons. Introduction ~~~~~~~~~~~~ This patch represents a "developer 's" version of the exp/skills system. While I have now achieved all of the objectives in sections "B" and "C" of the coding proposal (see README.PROPOSAL) and have play-tested as much of the code as possible, I am sure some big bugs must remain. (One for sure is that exp gained when using rod/horn/wand is wrong.) Below this section I outline 1) coding philosophy, 2) gross description of how the code impinges/interacts within older code. 3) designer's notes on the changes to the code. Comments on any area of this coding would be appreciated. Personally, I would like to see the Pow stat and a 2-type system of magic come into being. After all of you check out the code, I would like to discuss enhancements/bug fixes/implementation. For instance, is it too hard to figure out how to use the code! Sometime tomorrow exp2.tar.gz will be available in pub/thomas on ftp.astro.psu.edu. b.t. Code Philosophy ^^^^^^^^^^^^^^^ To move CF over to a new skills-based experience system. In this implementation several kinds of experience will exist. Players will gain experience in each kind of experience (or category) based on their actions in the game. The sum of all the various categories of experience equals the player "score", from which dam, wc, and hp are determined. All experience gaining actions will be through the use of certain skills -- so called "associated skills". Associated skills are each related to 1 kind of experience. Thus, for example, "stealing" is a skill associated with "agility" experience. There exists also "miscellaneous" skills which allow the use of a unique skill, but which are not related to any kind of experience and whose use does not generate experience points. In this implementation, skills and objects are both treated as objects in the inventory of the user. Experience "objects" each represent one kind of experience and are always invisible. Skills objects each represent one kind of skill available in the game. Skills objects may either be invisible or have an associated bitmap (in which case they are "tools"). All experience gaining actions will be through the use of certain skills -- called "associated skills". Associated skills are each related to 1 kind of experience. Thus, for example, "stealing" is a skill associated with "agility" experience. Both Players and NPC's may only use skills which are in their inventories. NPC's do not use experience objects. A breakdown of the properties of skills and exp objects objects is as follows: ---- Object Property NPC use? ------ ----------------------------------- ------- Experience Each represents a different kind of NO experience in the game. The object in the player inventory keeps track of player experience in that category. Always is invisible. Skill- Represents a skill the player may YES associated perform. May be either invisible or visible as a "tool". Successful use of this skill generates experience. Experience is allocated to appropriate experience object. Skill- Same as above, *but* this skill is not YES miscell. related to any experience category, and use of this skill generates *no* experience. ---- Linking of associated skills to experience categories is done during initialization of the code (in init()) based on the shared stats of both. How skills and experience categories are named and linked may be changed by editing the skills/experience object archetypes. Implementation Details ~~~~~~~~~~~~~~~~~~~~~~ The most important thing is that I moved most of the code into the server/skills.c and server/skill_util.c files. The skills code is loosely implemented along the lines of the spell code. This is to say that: . skills use (do_skill) is called from fire(). . there is a skills[] table similar to spells[]. . server files skills.c and skill_util.c parallel spell_effect.c and spell_util.c in respective functionallity. Particular notes about the implementation are outlined below. Defines ^^^^^^^ #define MAX_EXP_CAT be > I had to make use of several global parameters These are
Definition: arch-handbook.txt:525
create-tower.tile
tile
Definition: create-tower.py:8
make_face_from_files.int
int
Definition: make_face_from_files.py:32