アットウィキロゴ

konbbb;

class monopoly{
 
card: String[] = new Array();
a: number[] = new Array();
b: number[] = new Array();
point: number[] = new Array();
v: number[] = new Array();
money: number[] = new Array();
 
faststep():void{
 
this.card[	1	]="GO";
this.card[	2	]="地中海通り";
this.card[	3	]="共同基金";
this.card[	4	]="バルティック通り";
this.card[	5	]="所得税";
this.card[	6	]="リーディング鉄道";
this.card[	7	]="オリエンタル通り";
this.card[	8	]="チャンス";
this.card[	9	]="バーモント通り";
this.card[	10	]="コネチカット通り";
this.card[	11	]="刑務所、刑務所見学";
this.card[	12	]="セントチャールズプレース";
this.card[	13	]="電力会社";
this.card[	14	]="ステーツ通り";
this.card[	15	]="バージニア通り";
this.card[	16	]="ペンシルバニア鉄道";
this.card[	17	]="セントジェームスプレース";
this.card[	18	]="共同基金";
this.card[	19	]="テネシー通り";
this.card[	20	]="ニューヨーク通り";
this.card[	21	]="フリーパーキング";
this.card[	22	]="ケンタッキー通り";
this.card[	23	]="チャンス";
this.card[	24	]="インディアナ通り";
this.card[	25	]="イリノイ通り";
this.card[	26	]="B&O 鉄道";
this.card[	27	]="アトランティック通り";
this.card[	28	]="ベントノール通り";
this.card[	29	]="水道会社";
this.card[	30	]="マービンガーデン";
this.card[	31	]="GO TO JAIL";
this.card[	32	]="パシフィック通り";
this.card[	33	]="ノースキャロライナ通り";
this.card[	34	]="共同基金";
this.card[	35	]="ペンシルバニア通り";
this.card[	36	]="ショートライン鉄道";
this.card[	37	]="チャンス";
this.card[	38	]="パークプレース";
this.card[	39	]="物品税";
this.card[	40	]="ボードウォーク";
 
this.point[	1	]=	0	;
this.point[	2	]=	60	;
this.point[	3	]=	0	;
this.point[	4	]=	60	;
this.point[	5	]=	0	;
this.point[	6	]=	200	;
this.point[	7	]=	100	;
this.point[	8	]=	0	;
this.point[	9	]=	100	;
this.point[	10	]=	120	;
this.point[	11	]=	0	;
this.point[	12	]=	140	;
this.point[	13	]=	150	;
this.point[	14	]=	140	;
this.point[	15	]=	160	;
this.point[	16	]=	200	;
this.point[	17	]=	180	;
this.point[	18	]=	0	;
this.point[	19	]=	180	;
this.point[	20	]=	200	;
this.point[	21	]=	0	;
this.point[	22	]=	220	;
this.point[	23	]=	0	;
this.point[	24	]=	220	;
this.point[	25	]=	240	;
this.point[	26	]=	200	;
this.point[	27	]=	260	;
this.point[	28	]=	260	;
this.point[	29	]=	150	;
this.point[	30	]=	280	;
this.point[	31	]=	0	;
this.point[	32	]=	300	;
this.point[	33	]=	300	;
this.point[	34	]=	0	;
this.point[	35	]=	320	;
this.point[	36	]=	200	;
this.point[	37	]=	0	;
this.point[	38	]=	350	;
this.point[	39	]=	0	;
this.point[	40	]=	400	;
 
this.v[	1	]=	0	;
this.v[	2	]=	50	;
this.v[	3	]=	0	;
this.v[	4	]=	50	;
this.v[	5	]=	0	;
this.v[	6	]=	0	;
this.v[	7	]=	50	;
this.v[	8	]=	0	;
this.v[	9	]=	50	;
this.v[	10	]=	50	;
this.v[	11	]=	0	;
this.v[	12	]=	100	;
this.v[	13	]=	0	;
this.v[	14	]=	100	;
this.v[	15	]=	100	;
this.v[	16	]=	0	;
this.v[	17	]=	100	;
this.v[	18	]=	0	;
this.v[	19	]=	100	;
this.v[	20	]=	100	;
this.v[	21	]=	0	;
this.v[	22	]=	150	;
this.v[	23	]=	0	;
this.v[	24	]=	150	;
this.v[	25	]=	150	;
this.v[	26	]=	0	;
this.v[	27	]=	150	;
this.v[	28	]=	150	;
this.v[	29	]=	0	;
this.v[	30	]=	150	;
this.v[	31	]=	0	;
this.v[	32	]=	200	;
this.v[	33	]=	200	;
this.v[	34	]=	0	;
this.v[	35	]=	200	;
this.v[	36	]=	0	;
this.v[	37	]=	0	;
this.v[	38	]=	200	;
this.v[	39	]=	0	;
this.v[	40	]=	200	;
 
 
}
 
move(s:number):void{
 
var n1,n2,m1,m2:number;
n1=6*Math.random();
m1=Math.floor(n1)+1;
n2=6*Math.random();
m2=Math.floor(n2)+1;
 
this.a[s]=this.a[s]+m1+m2;
 
if(m1==m2){
n1=6*Math.random();
m1=Math.floor(n1)+1;
n2=6*Math.random();
m2=Math.floor(n2)+1;
this.a[s]=this.a[s]+m1+m2;
if(m1==m2)this.jail(s);
}
 
 
if(this.a[s]>40)this.money[s]=this.money[s]+200;
if(this.a[s]>40)this.a[s]=this.a[s]-40;
 
var sx,h:number;
sx=this.a[s];
 
h=0;
if(this.b[sx]==0)h=h+1;
if(this.point[sx]>0)h=h+1;
if(h==2)this.money[s]=this.money[s]-this.point[sx];
if(h==2)this.b[sx]=s;
 
var k:number;
 
k=this.b[sx];
h=0;
if(this.b[sx]>0)h=h+1;
if(this.point[sx]>0)h=h+1;
if(h==2)this.money[s]=this.money[s]-50;
if(h==2)this.money[k]=this.money[k]+50;
 
this.tax(s);
 
if(this.a[s]==31)this.jail(s);
if(this.a[s]==3)this.kyo(s);
if(this.a[s]==18)this.kyo(s);
if(this.a[s]==34)this.kyo(s);
if(this.a[s]==8)this.chance(s);
if(this.a[s]==23)this.chance(s);
 
}
 
tax(s:number):void{
 
if(this.a[s]==5)this.money[s]=this.money[s]-200;
if(this.a[s]==39)this.money[s]=this.money[s]-100;
 
 
}
 
chance(s:number):void{
 
var c:string[]=new Array();
 
var m1,m2:number;
 
m1=16*Math.random();
m2=Math.floor(m1)+1;
 
if(m2==1)this.a[s]=12;
if(m2==2)this.a[s]=25;
if(m2==3)this.a[s]=40;
if(m2==4)this.a[s]=6;
if(m2==8)this.a[s]=this.a[s]-3;
if(m2==9)this.money[s]=this.money[s]+150;
if(m2==10)this.money[s]=this.money[s]+50;
if(m2==11)this.money[s]=this.money[s]-15;
if(m2==12)this.money[s]=this.money[s]-50;
if(m2==14)this.a[s]=1;
if(m2==16)this.jail(s);
 
c[1]="セントチャールズプレースへ進む";
c[2]="イリノイ通りへ進む";
c[3]="ボードウォークへ進む";
c[4]="リーディング鉄道へ進む";
c[5]="次の鉄道まで進み、通常の2倍のレンタル料を支払う";
c[6]="次の鉄道まで進み、通常の2倍のレンタル料を支払う";
c[7]="次の水道会社か電力会社に進む(所有者がいたら、ダイスの目の10倍を支払う)"
c[8]="3マス戻る";
c[9]="銀行より$150受取る";
c[10]="銀行より$50受取る";
c[11]="銀行へ$15支払う";
c[12]="各プレーヤーに$50支払う";
c[13]="修理費、家1軒あたり$25、ホテル1軒あたり$100を支払う";
c[14]="GOのマスへ進む"
c[15]="刑務所から釈放 (通称:釈放券)"
c[16]="刑務所へ行く";
}
 
kyo(s:number):void{
 
var c:string[]=new Array();
 
var m1,m2:number;
 
m1=17*Math.random();
m2=Math.floor(m1)+1;
 
if(m2==1)this.money[s]=this.money[s]+200;
if(m2==2)this.money[s]=this.money[s]+100;
if(m2==3)this.money[s]=this.money[s]+100;
if(m2==4)this.money[s]=this.money[s]+100;
if(m2==6)this.money[s]=this.money[s]+50;
if(m2==7)this.money[s]=this.money[s]+25;
if(m2==8)this.money[s]=this.money[s]+20;
if(m2==9)this.money[s]=this.money[s]+10;
if(m2==10)this.money[s]=this.money[s]-50;
if(m2==11)this.money[s]=this.money[s]-50;
if(m2==12)this.money[s]=this.money[s]-100;
 
c[1]="銀行より$200受取る";
c[2]="生命保険満期により$100受取る";
c[3]="クリスマス基金の満期により$100受取る";
c[4]="遺産$100受取る";
c[5]="オペラのチケット代$10を各人から徴収できる";
c[6]="株式売却により$50受取る";
c[7]="礼金として$25受取る"
c[8]="所得税$20戻る";
c[9]="ビューティーコンテスト準優勝、$10受取る";
c[10]="治療費$50支払う";
c[11]="出産費$50支払う";
c[12]="教育費として$100支払う";
c[13]="修理費、家1軒あたり$25、ホテル1軒あたり$100を支払う";
c[14]="道路の修理費として家1軒あたり$40 、ホテル1軒あたり$115支払う"
c[15]="GO のマスへ進む"
c[16]="刑務所から釈放";
c[17]="刑務所へ行く";
 
}
 
jail(s:number):void{
 
this.a[s]=11;
this.money[s]=this.money[s]-50;
 
}
} 
 
最終更新:2016年11月22日 06:29