- Timestamp:
- 2014-07-24 14:56:52 (9 years ago)
- Location:
- 2014/30/AleksiK
- Files:
-
- 1 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
2014/30/AleksiK/TToDHS/TToDHS/TToDHS/TToDHS.cs
r5588 r5636 40 40 Label luetDocua; 41 41 Label potionInInv; 42 43 //TO DO: Nainen + MustaTakit, TutorialBattle + Stats + Party, Tarinaa ->, muut huoneet, itemit, battlet 42 Label taisto1; 43 Label taisto2; 44 Label taisto3; 45 46 //TO DO: TutorialBattle, Tarinaa ->, muut huoneet, itemit, battlet 44 47 45 48 public override void Begin() … … 69 72 steinExp.UpperLimit += delegate { steinExp.MaxValue *= steinLvl.Value; }; 70 73 steinExp.UpperLimit += delegate { steinExp.Reset(); }; 74 mustaTakkiHp.MinValue = 0; 71 75 } 72 76 … … 210 214 Keyboard.Listen(Key.W, ButtonState.Down, AsiaNopeus, null, stein, 0.0, ruutuNelionSivu * 5, 0.0); 211 215 Keyboard.Listen(Key.S, ButtonState.Down, AsiaNopeus, null, stein, 0.0, -ruutuNelionSivu * 5, 0.0); 212 Keyboard.Listen(Key.E, ButtonState.Pressed, InventorinTilanMuutos, null, 0 );216 Keyboard.Listen(Key.E, ButtonState.Pressed, InventorinTilanMuutos, null, 0, 0); 213 217 } 214 218 … … 411 415 //Laita Label("Inventory") Inventoryn yläosaan! 412 416 413 void InventorinTilanMuutos(int x )414 { 415 if (x == 0 )417 void InventorinTilanMuutos(int x, int y) 418 { 419 if (x == 0 && y == 0) 416 420 { 417 421 ClearControls(); 418 Keyboard.Listen(Key.E, ButtonState.Pressed, InventorinTilanMuutos, null, 1 );422 Keyboard.Listen(Key.E, ButtonState.Pressed, InventorinTilanMuutos, null, 1, 0); 419 423 420 424 inventory = PhysicsObject.CreateStaticObject(ruutuNelionSivu * 10, ruutuNelionSivu * 20); … … 435 439 } 436 440 437 else if (x == 1 && potionLaskuri.Value > 0)441 else if (x == 1 && y == 0 && potionLaskuri.Value > 0) 438 442 { 439 443 inventory.Destroy(); … … 442 446 } 443 447 444 else if (x== 1 )448 else if (x== 1 && y == 0) 445 449 { 446 450 inventory.Destroy(); 447 451 SteinKontrollit(0); 448 452 } 453 454 else if (x == 0 && y == 1) 455 { 456 taisto1.Destroy(); 457 taisto2.Destroy(); 458 taisto3.Destroy(); 459 460 Keyboard.Listen(Key.E, ButtonState.Pressed, InventorinTilanMuutos, null, 1, 1); 461 462 inventory = PhysicsObject.CreateStaticObject(ruutuNelionSivu * 10, ruutuNelionSivu * 20); 463 inventory.Color = Color.LightGray; 464 inventory.IgnoresCollisionResponse = true; 465 inventory.CollisionIgnoreGroup = 1; 466 inventory.Position = taistoStein.Position; 467 Add(inventory); 468 469 if (potionLaskuri.Value > 0) 470 { 471 potionInInv = new Label("Potion"); 472 potionInInv.Position = new Vector(-inventory.Width / 4, inventory.Height / 7 * 2.3); 473 potionInInv.Font = Font.DefaultLarge; 474 potionInInv.TextColor = Color.Red; 475 Add(potionInInv); 476 } 477 } 478 479 else if (x == 1 && y == 1 && potionLaskuri.Value > 0) 480 { 481 inventory.Destroy(); 482 potionInInv.Destroy(); 483 ClearControls(); 484 LuoTaistoValikko(); 485 } 486 487 else if (x == 1 && y == 1) 488 { 489 inventory.Destroy(); 490 ClearControls(); 491 LuoTaistoValikko(); 492 } 449 493 } 450 494 … … 454 498 { 455 499 steinLuontiPiste = stein.Position; 456 HuoneenValo(0, 2); 457 458 Timer.SingleShot(0.75, delegate { ClearGameObjects(); 459 //HuoneenValo(0, 1); 460 TileMap taistelu = TileMap.FromLevelAsset("Taistelu"); 461 taistelu.SetTileMethod('V', LuoTaistoon, 0); 462 taistelu.SetTileMethod('S', LuoTaistoon, 1); 463 taistelu.SetTileMethod('N', LuoTaistoon, 2); 464 taistelu.Execute(ruutuNelionSivu, ruutuNelionSivu); }); 465 Timer.SingleShot(1.5, delegate { LuoTaistoValikko(); }); 500 //HuoneenValo(0, 2); 501 ClearGameObjects(); 502 //HuoneenValo(0, 1); 503 TileMap taistelu = TileMap.FromLevelAsset("Taistelu"); 504 taistelu.SetTileMethod('V', LuoTaistoon, 0); 505 taistelu.SetTileMethod('S', LuoTaistoon, 1); 506 taistelu.SetTileMethod('N', LuoTaistoon, 2); 507 taistelu.Execute(ruutuNelionSivu, ruutuNelionSivu); 508 LuoTaistoValikko(); 466 509 } 467 510 … … 499 542 taistoKohdat = new List<Label>(); 500 543 501 Labeltaisto1 = new Label("Attack");544 taisto1 = new Label("Attack"); 502 545 taisto1.Position = new Vector(-160, -30); 503 546 taisto1.Font = Font.DefaultLarge; 504 547 taistoKohdat.Add(taisto1); 505 548 506 Labeltaisto2 = new Label("Defend");549 taisto2 = new Label("Defend"); 507 550 taisto2.Position = new Vector(-10, -30); 508 551 taisto2.Font = Font.DefaultLarge; 509 552 taistoKohdat.Add(taisto2); 510 553 511 Labeltaisto3 = new Label("Inventory");554 taisto3 = new Label("Inventory"); 512 555 taisto3.Position = new Vector(140, -30); 513 556 taisto3.Font = Font.DefaultLarge; … … 519 562 } 520 563 564 LuoTaistoValikonHiiri(); 565 } 566 567 void LuoTaistoValikonHiiri() 568 { 521 569 Mouse.ListenOn(taisto1, MouseButton.Left, ButtonState.Pressed, SteinAttack, null); 522 570 Mouse.ListenOn(taisto2, MouseButton.Left, ButtonState.Pressed, SteinDefend, null); 523 Mouse.ListenOn(taisto3, MouseButton.Left, ButtonState.Pressed, InventorinTilanMuutos, null, 0 );571 Mouse.ListenOn(taisto3, MouseButton.Left, ButtonState.Pressed, InventorinTilanMuutos, null, 0, 1); 524 572 Mouse.ListenMovement(1.0, TaistoKohtaHiiri, null); 525 573 } … … 541 589 } 542 590 591 //ERROR: MaxValue must be greater than zero. -Kohdassa mustaTakki.Hp -= jne... 592 543 593 void SteinAttack() 544 594 { 545 mustaTakkiHp.Value -= (steinDmg.Value -= mustaTakkiDef.Value); 595 mustaTakkiHp.Value -= (steinDmg.Value -= mustaTakkiDef.Value += RandomGen.NextInt(1 - 4)); 596 mustaTakkiHp.LowerLimit += delegate { taistoMustaTakki.Destroy(); }; 546 597 } 547 598
Note: See TracChangeset
for help on using the changeset viewer.