-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathunitMonster.php
More file actions
58 lines (53 loc) · 1.22 KB
/
unitMonster.php
File metadata and controls
58 lines (53 loc) · 1.22 KB
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
<?php
/**
* Created by PhpStorm.
* User: yangzhenyu
* Date: 2018/12/10
* Time: 上午9:23
*/
require_once 'vendor/autoload.php';
\EasySwoole\EasySwoole\Core::getInstance()->initialize();
$id = '乞丐';
$bean = new \App\Bean\People\Monster();
$bean->setName('乞丐');
$bean->setHit('100'); //命中
$bean->setArmor('33'); //护甲
$bean->setDps('33'); //伤害
$bean->setLifeValue('55'); //生命
$bean->setInjury('5'); //伤势
$bean->setLevel(1); //登记
$bean->setSkill([ "左钩拳"]);
$bean->setLocation('沧海'); //所在地
$bean->setDodge(60); //躲避
$bean->setMood(5); //心情
$bean->setDrop('金钱,经验,疯狗拳');
$bean->setBank(100);
$bean->setM(33);
$bean->setT(33);
$bean->setZ(33);
$bean->setL(33);
$rule = new \App\Bean\People\DropRule();
$rule->setLuckRule(0.3);
$rule->setRule(
[
[
'odds'=>'100',
'thing'=>['exp'=>10]
],
[
'odds'=>'50',
'thing'=>['money'=>5]
],
[
'odds'=>'10',
'thing'=>['skill'=>'疯狗拳']
]
]
);
$bean->setDropRule(
$rule
);
$tools = new \App\Tools\DataTools();
$tools->setMonsterData($id,$bean);
echo PHP_EOL;
var_dump($tools->getMonsterData($id));