-
Notifications
You must be signed in to change notification settings - Fork 2
/
make_map.php
72 lines (59 loc) · 2.36 KB
/
make_map.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
define ('INCLUDE_DIR','include/');
require INCLUDE_DIR.'paths.php';
require INCLUDE_DIR.'map_consts.php';
require INCLUDE_DIR.'map_store.php';
require INCLUDE_DIR.'monster_store.php';
require INCLUDE_DIR.'job_store.php';
require INCLUDE_DIR.'character.php';
#$mapid=$_GET['mapid'];
#$width=$_GET['width'];
#$height=$_GET['height'];
$mapid=1;
$leveling_area_size=4;
$width=256*$leveling_area_size*2;
$height=$width;
//Get the monster list.
$monster_store=new MONSTER_STORE;
$monsters=&$monster_store->get_all_monsters();
//Get the job list
$job_store=new job_STORE;
$jobs=&$job_store->get_all_jobs();
//Get the average XP per level
for($level=1;$level<256;++$level)
{
$xp_at_level=0;
//Make one hero of each job at this level.
foreach($jobs as $jobid=>$job)
{
$hero=hero($job->name,$jobid,$level,0);
$xp_at_level+=$hero->calculate_pxp();
}
$xp_at_level/=count($jobs);
//Now use this avarage XP to make monster parties.
}
$tileset=array(
array('filename'=>"prairie.png" ,'pass'=> 0,'poison'=> 0,'encounter'=> 2),
array('filename'=>"hill.png" ,'pass'=> 0,'poison'=> 0,'encounter'=> 4),
array('filename'=>"desert.png" ,'pass'=> 0,'poison'=> 0,'encounter'=> 5),
array('filename'=>"forest.png" ,'pass'=> 0,'poison'=> 0,'encounter'=> 6),
array('filename'=>"cave.png" ,'pass'=> 0,'poison'=> 0,'encounter'=> 0),
array('filename'=>"castle.png" ,'pass'=> 0,'poison'=> 0,'encounter'=> 0),
array('filename'=>"town.png" ,'pass'=> 0,'poison'=> 0,'encounter'=> 0),
array('filename'=>"tower.png" ,'pass'=> 0,'poison'=> 0,'encounter'=> 0),
array('filename'=>"poison.png" ,'pass'=> 0,'poison'=> 2,'encounter'=> 7),
array('filename'=>"poison2.png" ,'pass'=> 0,'poison'=>15,'encounter'=> 10),
array('filename'=>"mountains.png",'pass'=> 2,'poison'=> 0,'encounter'=> 0),
array('filename'=>"water.png" ,'pass'=> 1,'poison'=> 0,'encounter'=> 3),
array('filename'=>"wall.png" ,'pass'=>-1,'poison'=> 0,'encounter'=> 0)
);
$map=new MAP($width,$height,null,null,$tileset,array(),array(),array());
//Design-a-map!
#This will take a lot more thought than I want to right now.
#This by default will make a huge expanse of prairie.
#Make a few plots of differing strength monsters on the map.
//Save the map
$map_store=new MAP_STORE();
$map_store->put_map(0,$map);
echo "Done! $map is $width*$height";
?>